Await Action

For some complex Workflows, you may wish to break your logic into steps, and supply additional information via API at those later steps. For example, you might build a new account signup Workflow where some percentage of customers might need to supply their drivers license number for an additional check.

To support this, Sliderule offers the Await Action logic block. When this block is reached, your Workflow will return in a paused state. You can then pass additional information to the second step of the workflow by calling the Resume Execution endpoint.

Using the Await Action block

In our example Workflow, the yellow Get More Info block is an Await Action block. If an Execution goes down the conditional path and reaches this block, it will return a status of paused.

In addition to the status, you can also supply a Pause Message, to make it clear what additional data is required. If the Await Action block is reached in our sample Workflow, we'll use the message 'send drivers license'. If an Execution hits the block, the returned output will look something like this:

{
    "executionId": 0,
    "executionTemporaryId": "e4c4aeb0-c78c-4fdd-a4b4-7bf806bf0752",
    "result": "PAUSED",
    "resumeInstructions": {
        "resumeUrl": "https://api-dev.usemodernlogic.com/v1/execution/e4c4aeb0-c78c-4fdd-a4b4-7bf806bf0752/resume",
        "data": {},
        "pauseMessage": "send drivers license"
    },
    "warnings": [],
    "dateEvaluated": "2022-05-20",
    "definedVariables": {},
    "timeOfExecution": "2022-05-20T15:15:26.444Z",
}

Notice the result is PAUSED, and there is a special section on how to resume execution. To resume the workflow, we'll hit the Resume Execution endpoint with the executionTemporaryId and additional data fields. You can copy the whole resumeURL for convenience. An example Postman call to resume and supply a single additional property is below.

Executions can be left in a pending state indefinitely, unless you set a timeout (explained below).

Additional Settings

Like any of the Data Connectors, Await Action blocks allow you to configure a Timeout/Error Path. You can set up an Action to take (including Breakout Paths to other Logic Blocks) by clicking on the Timeout tab of the Await Action block.

If you have data flowing in from your Data Connectors, you can also choose to pass some of that data back along with the paused message returned by the Await Action block. You can configure that on the Response tab of the block.

Finally, once you've used this block in Executions or Testing, and have actually hit the Resume Execution endpoint for it a few times, you'll the fields you're passing in your Resume call populate in the Properties tab of the block. These properties can then by called just like any other fields from any other Data Connector, in all subsequent rules of the Workflow.


Did this page help you?