Showing results for 
Search instead for 
Did you mean: 

Better Together: Nintex RPA & NWC – Workflow Waiting for a Botflow to Finish

Nintex Employee
Nintex Employee
0 0 540

Introduction & Background

All the blogs in this series were inspired by an internal use case that I worked on a few months ago. The licensing software for Nintex RPA did not have any API for workflow to attach onto, so all automation needed to happen through the user interface. Using a combination of Nintex RPA, Nintex Workflow Cloud and Forms, we automated the trial provisioning process from start to finish.


A user can now fill out a form online, which starts the workflow. The Nintex Workflow Cloud workflow takes the user’s input, and uses the Document Generation action to produce an Excel file. That Excel file is dropped into a cloud drive, such as OneDrive, for Nintex RPA to pick up and process. Nintex RPA recognized the file, scraped the data from it to provision the license needed. After the licensing software produced the product key, Nintex RPA passed that back off to the running & waiting workflow. From there, the workflow “unpaused” to continue with the rest of the process (accessing Salesforce, emailing, approvals, etc.).

Now, obviously, readers of this won’t be provisioning Nintex RPA licenses… this is more-so about the idea of passing off automation from workflow to botflow seamlessly, in order for the botflow to handle tasks that a workflow can’t get to. Maybe something like filling out a form to order business supplies, or a external-facing form that has data that needs to be input to SAP. The possibilities are endless.


Previous entires in this series:

Building on my previous blog posts, I have a workflow that triggers a Nintex RPA botflow to run. My problem now is, I need Nintex RPA to do some work and then tell NWC it is done so the workflow can continue.


I could use the Run Workflow action at the end of my botflow to start a separate workflow, but then that just needlessly breaks up the process which could cause confusion down the line when it needs maintenance.


We already know it’s possible for a botflow to wait for a file from a workflow, but what about the other way around? Nintex RPA can move a file to a specified location, where the workflow would be monitoring. In Nintex RPA itself, this would be easy: just use the Wait for File action. But Nintex Workflow Cloud doesn’t have anything packaged up nicely in one action like this so there is some work to be done to get something like this built out.

Nintex Workflow Cloud Setup
Let’s take a look at the workflow steps I’ve come up with to accomplish this:Workflow Cap.png

Now let’s break this down action-by-action:

  1. Wait for RPA to Finish – Action Set:
    • This is just an action set to make the workflow more readable. In reality, this will be collapsed most of the time.

  2. Wait until File is Found – Start a Loop:
    • This is what will drive the “waiting” that the workflow will do. This loop will be running only when the specified file (designated below) is NOT found. There is only one condition needed for this.

      Step 2 Config.png
  3. Clear Collection:
    • This clears the collection variable that will be populated later call Folder Contents. This isn’t strictly necessary, but I like to clear variables before or after they are used.

  4. Get Folder Contents:
    • This is what will populate the Folder Contents collection variable. In my case, I have used Google Drive, but any of the other cloud file storage options would work just as well, such as OneDrive, Box, etc.

      Step 4 Config.png


  5. Check for trigger file – Check if Item Exists in Collection:
    • This action is where we are checking for our trigger file. This sets the variable that controls the loop running.

      Step 5 Config.png
  6. Pause for Duration
    • And finally, this action controls how long the workflow will pause between checks. Depending on how long the botflow takes to run through, this pause time will change. I’ve got my action configured to wait 1 minute between checks, but yours may need to be longer.


The Actions in Nintex RPA

From the botflow side, to create the file from this directory, it is as simple as using a Write File action.

Write File Config.png


This will create the TXT file that we have instructed the workflow to wait for.



Clean Up Afterwards

One last thing to consider is the cleanup of this trigger file between runs. You can approach this in a couple different ways.

  1. Have the workflow delete the file with a Delete a file action. This can happen at the beginning of the workflow, or right after it detects it.
  2. Have the botflow delete the trigger file with a Delete file action before the rest of the work starts. This would need to happen immediately, as the first step in the botflow. This option is less ideal, since the workflow might 'find' the file prematurely.

This does need to happen for the workflow pause to be successful, and option 1 would be the better of the two choices.


Any thoughts, questions, concerns, please feel free to chime in below in the comments section. :) Thanks for reading, as always!
- John

Note: This blog was written using version 15 of the Foxtrot Suite. Readers in the future may have a different experience than outlined in the blog post above.