Post-request script

Introduction

Typically, a process flow run is triggered and a request for data is made via a connector shape - if the request is successful, data is retrieved and the flow continues.

However, there may be scenarios where you need to control whether the connector shape or process flow run should fail or continue based on information returned from the connection request. To achieve this you can apply a post-request script to your endpoint.

In the context of endpoints, post-request scripts and response scripts are the same thing.

Usage

When a post-request script is added to an endpoint, it is applied wherever that endpoint is used in process flows.

If your post-request script should only be applied to specific flows, we recommend applying it as a response script for the connector shape in required flows. For more information please see: Using connector shape response scripts.

About post-request scripts

A post-request script receives the response code, headers, and body from connection requests and - utilising response_code actions - returns a value determining whether the connector shape/flow run continues or stops.

Creating post-request scripts

Post-request scripts are written and deployed in the usual way, via the custom scripts option. However, two additional options can be used: response_code and message. For more information about working with these options, please see: Using connector shape response scripts.

Applying a post-request script to an endpoint

Any script you want to apply must be created as a custom script first.

Step 1 Select the post-request script tab for your endpoint:

Step 2 Click in the select a script field and choose the script that you want to use - for example:

All scripts created for your company are available for selection.

Step 3 Choose the script version that you want to use:

Step 4 Review the script code to be applied, then click the save and go back button:

If you need to change the script code, this should be done in the custom scripts area, then (if appropriate) come back in and update the script version here.

Last updated