Skip to main content
Nintex Community Menu Bar

Here is the scenario I am working on:

  1. I have a SharePoint online list which stores and tracks submissions for approval.
  2. Automation Cloud Workflow is a state machine workflow which contains branches for every approval stage.
  3. I have created separate component workflow to manage the approval task at each stage.  
  4. Approvers have the ability to respond to the task email, edit the task form, or manually update the item in the SharePoint list. 
  5. If the item is approved in the list, I want to terminate the component workflow. (fyi, I was able to do this easily on -prem).

Shown below:

  1. Set permissions on the item.
  2. Start Internation Approval Workflow (this is the component workflow).
  3. Wait for the Int’l Review Status to not = Pending Review.
  4. Get the latest details of the item.
  5. Check to see if Approved by WF. (note: in the component workflow I update an ApprovedbyWorkflow field = Yes if it’s approved there)
  6. If it’s not approved by workflow, get the CurrentApproverDisplayName (used for other reasons in the WF)
  7. And now I want to stop the workflow running above.

My dilemma:

Before I go down the rabbit hole of setting up a connection to use with the Terminate Workflow Instance, I want to make sure this is the right approach. I’m a bit confused about having to set up a connection to the SharePoint list as the workflow is not an O365 workflow.

Any advise would be appreciated.

 

Hi @tmfitz,

Your logic seems fine. The terminate workflow instance action uses a NAC connection (not SharePoint). You will have to pass the workflow instance ID (found in the context variables) from the component/sub/approval workflow through to the main workflow.

Another way of doing this is using a parallel path action with a completion condition (it uses a Boolean variable):

So basically on one side I have call a workflow to call the approval component workflow and on the other side i have a wait for change in a sp list, so if the status is changed manually (the condition will be something like ApprovedbyWorkflow field != Yes or ApprovedbyWorkflow field is empty), then it will set a boolean variable (e.g. completed manually) = yes which is used in a runif to terminate the workflow. If the workflow is approved via the sub workflow, it will just continue down the first branch and skip the runif.

But yeah, think you are on the right approach.


Hi @tmfitz 

  1. The connection used in the “Terminate workflow instance” is a Nintex NWC/NAC connection and not a SharePoint connection.
  2. Each workflow that runs has its own WF Instance ID. This can be access from the Context → WF Instance ID. As you can only access the current workflow Instance ID in the current workflow, You need to save this value external (either to your SharePoint List or Azure SQL)
  3. If you want to terminate the Component workflow, you will need it’s Workflow Instance ID

     

  4. Is the component workflow running in an infinite loop? If just run once, Why don’t you just let it end naturally. If there is no further instructions, the workflow should end.

     

 

 

 

 

 

 

 

 

 


Thanks @Garrett  for your response.  I’m going to take your approach as it requires less change in my workflow.  To answer your question, the workflow I want to terminate has an approval task which sends a reminder every day to approve.  It won’t end until the task is answered.

I did create the NAC connector using the following steps:

  1. Set up app in NAC settings.
  2. Set up the NAC connector using the Client ID and Client Secret from the app.  Client Secret is blank when I go back into connector settings. I’m guessing that’s by design.
     

     

Then in the workflows I:

  1. Return the Workflow Instance ID from the Approval component workflow.
  2. Then I pass the ID into the Terminate Workflow action.

I get following error when I test.  Any ideas? Maybe I should post as a separate question.

 


Hi @tmfitz 

What is the setting when you call for the Composite Workflow?
 

I believe that you are using the “Run both workflows concurrently”. which means that main workflow isn’t getting back the composite workflow Instance ID.

If you wait for the composite workflow to complete, you don’t even need to terminate the composite workflow.  


@Garrett - Ah, you’re right.  Let me ponder this. Thanks for your help.


Hi @tmfitz 

I see, you do not want to have a reminder that goes on perpetually, right?

This will solve your issue - Use a “run parallel paths. which has a completion condition. Any branch which set boolean var “bol_isComplete” to Yes will cause the parallel path to end. 
 

 

Branch 2 - Set the Task Assign with Reminder. (You need to calc x reminders). 1st reminder is 1 days and subsequent reminder is 1 days. Once the Task Assign has been answered, the boolean var “bol_isComplete” is set to Yes and this ends the parallel path

Branch 1 - Set a pause for duration - 10days. After the pause, the boolean var “bol_isComplete” is set to Yes and this ends the parallel path

Next action is a End this workflow (you could also use the Terminate action)

 


Reply