Wf error on site

sns 9,246 Reputation points
2020-11-09T11:42:10.97+00:00

I am trying to create a new workflow but coming up with below message. Please help
Microsoft.Workflow.Client.InvalidRequestException: Scope '/SP2016_Prod/default/049dbd8c-2a52-4988-8a79-4b8fd10840a2/e2a09733-abcb-46e4-af63-26704c24e14a' is not in an updatable state. Its current state is 'Unregistered'. HTTP headers received from the server - ActivityId: 9ec115b5-ebe9-4922-8f96-05feb9bfaa8f. NodeId: DLEV2042. Scope: /SP2016_Prod/default/049dbd8c-2a52-4988-8a79-4b8fd10840a2/e2a09733-abcb-46e4-af63-26704c24e14a. Client ActivityId : 78ef8b9f-9d5c-e08e-1be7-1a711003c45e. ---> Syste

Microsoft 365 and Office SharePoint Server For business
0 comments No comments
{count} votes

Accepted answer
  1. Sharath Kumar Aluri 3,071 Reputation points
    2020-11-09T15:21:40.06+00:00
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,316 Reputation points
    2020-11-10T02:32:26.65+00:00

    Hi @sns ,

    38562-error.png

    As the error indicates, workflow publishing failed because the Workflow Manager scope for the site was in an unregistered state.

    To resolve this issue, please delete unregistered scope related to the site and its child subsites.

    1)From SharePoint server 2016, Open PowerShell as Admin and identify the ID of the affected subsite by using below script.

    Add-Pssnapin “Microsoft.SharePoint.PowerShell”        
    $webUrl = 'https://global.sharepoint.com/sites/sp/workflow Jump'  
    (Get-SPWeb $webUrl).ID  
    

    2)Open the SQL instance for the Workflow Manager which is hosting the Workflow Manager databases, confirm that the scopes are actually unregistered by running the below Queries.

    Ⅰ. Find the scope(s) related to the subsite

    --===============================    
    -- Use the web ID here...    
    DECLARE @webID nvarchar(50) = '867bb878-7803-4b19-a8b3-f642b4315e94'    
        
    --Change below to correct resource management DB name if needed    
    USE [WFResourceManagementDB]    
                   
    SELECT s.ScopeId, s.ParentScopeId, s.Path,    
           s.Status, s.HasTopic, s.Description,    
           s.RevisionNumber, s.Created, s.LastRevised,    
           s.DisplayName, s.RowVersion    
      FROM Scopes s WITH(nolock)    
      WHERE description = @webID    
      OR path like '%'+@webID+'%'    
      ORDER BY s.Path    
    --===============================   
    

    Ⅱ. View the parent scope through the ParentScopeId values output in .

    --===============================    
     -- Use ParentScopeId from Ⅰ. here...    
     DECLARE @parentScopeId uniqueidentifier = 'EABD89EE-B1A9-C480-D381-4EF089DD2617'    
          
     --Change below correct resource management DB name if needed    
     USE [WFResourceManagementDB]    
          
     SELECT s.ScopeId, s.ParentScopeId, s.Path,    
               s.Status, s.HasTopic, s.Description,    
               s.RevisionNumber, s.Created, s.LastRevised,    
               s.DisplayName, s.RowVersion    
      FROM Scopes s    
      WHERE s.ScopeId = @parentScopeId    
     --===============================   
    

    3) Identify and delete the related unregistered scopes as needed.

    a. Identify the related scopes, using same value from @ParentScopeId from above. ( If this doesn't work use below one)
    b. Use the below Query, I just passed the Web Id instead of the parent scope id. To check the status of the scope is “Unregistered”.

    SELECT * FROM Scopes s WITH (nolock)  
    WHERE s.Path like '%867bb878-7803-4b19-a8b3-f642b4315e94%'  
    

    c. We will only want to delete the scopes from this result set that are in an unregistered state.
    d. Delete only the unregistered scopes, using the same value from @ParentScopeId from above. ( If this doesn't work use below one)
    e. I just passed the Web Id instead of the parent scope id (as explained earlier). You could see that the result is “Unregistered”. And you can delete this unregistered scope.

    DELETE FROM Scopes  
    WHERE Path like '%867bb878-7803-4b19-a8b3-f642b4315e94%'  
    AND Status = 'Unregistered'  
    

    4) Republish all 2013 workflows in affected sites/subsites

    You could refer to the below article to read more information :

    Sharepoint 2013 Troubleshooting: Workflows failed to publish / something went wrong

    Thanks,
    Echo Du

    ======================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.