Unable to Save Imported Workflow
I imported a workflow from Production into Staging but am unable to save it. Why?
Whether you are exporting a workflow from Production or Staging and importing it into the other, there are a few things you need to check first. We'll review what causes a workflow not to be saved and how to fix it.
Receiving 'Unable to save the workflow' Message
Assuming your tapw file has been imported correctly, you may see an orange banner appear after clicking Save that says "Unable to save the workflow".
An error is thrown in the TAP error logs regarding a conflict with the workflow permissions, specifically with user roles.
Exception Error ==>
An error occurred while updating the entries. See the inner exception for details.
An error occurred while updating the entries. See the inner exception for details.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_WorkflowTemplatePermission_RoleLookup". The conflict occurred in database "prod_Project", table "dbo.RoleLookup", column 'ID'.
The statement has been terminated.
This error is caused by a user role existing in the original tenant where the workflow originated from NOT existing in the tenant where the workflow is being saved to. The application cannot find the user role to apply to the workflow permissions.
To Resolve
To resolve the error and successfully save the file you have two options:
1. Go back to the originating workflow and confirm which user roles are being used in the Workflow Permissions.
Ensure these same roles are added (via Administration) to the tenant where the workflow will be imported. Re-import the workflow and save as normal.
2. On the imported workflow in Designer, clear out the workflow permissions and click Save.
Your workflow will then be able to be saved successfully and you will see the green "Form workflow successfully saved." banner.