Running saved workflows
Run a workflow you built in the dashboard from your server with one call, and read the per-step results.
Build a workflow once in the dashboard workflow builder, then run it from your server with one call. Each step runs when the input it needs is in the request, and otherwise reports as skipped. Running workflows through the API needs a plan that includes custom workflows.
Run a workflow#
Send the numeric workflowId shown in the dashboard and the inputs your steps read to POST /api/v1/workflows/run. The run is synchronous: the per-step results are in the response.
curl -sS -X POST 'https://api.trustverify.co.uk/api/v1/workflows/run' \
-H "Authorization: Bearer $TRUSTVERIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": 12,
"inputs": {
"name": "Test Person",
"dateOfBirth": "1980-01-01",
"country": "GB"
}
}'| Field | Meaning |
|---|---|
workflowId | Required. The numeric id of one of your saved, active workflows. |
inputs | The values your steps read, such as userId, name, dateOfBirth, country, entityType, companyNumber, transactionId or ipAddress. |
context | An alias for inputs. If you send both they are merged, and inputs wins for a key in both. |
A webhookUrl on the request is not called: per-request callbacks are paused and the response carries callback not_sent. Use the result in the response.
The response#
status is completed, incomplete or failed, and results holds one entry per step. An AML step reads name, dateOfBirth, country and entityType; entityType takes the same values as the screening endpoint's type, and any other value is a 400.
Errors#
400: workflowId missing or not a number, the workflow is not active, or an input a step reads is invalid.404: no workflow with that id belongs to your account.403: your plan does not include custom workflows.