Skip to Content
WorkflowsTriggering a run

Triggering a run

A workflow starts when something POSTs to it. The JSON body becomes event.body, and the response comes back with a runId before the run finishes.

The token

Mint a token under Settings → API tokens. Pick All loops or one loop, and give it run access. The token is shown once, so store it before closing the dialog. Revoking it stops the next request.

The request

The organization id and the loop id are on the loop’s Access dialog.

curl -X POST https://api.ollie.health/loop/$ORG_ID/$LOOP_ID \ -H "Authorization: Bearer $LOOPS_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "patientId": "pat_18", "phoneNumber": "+15551234567" }'
Method and pathPOST /loop/:organizationId/:loopId
AuthorizationBearer, then the token. A missing, revoked, or out-of-scope token returns 401.
BodyJSON. It arrives as event.body.

The response

{ "runId": "run_91", "workflowInstanceId": "run_91" }

The caller does not wait for the run. Read the steps, the logs, and the output under Runs.

When any file in the project calls ctx.FACIAL_SCAN.create, the response also includes scanSessionId and scanUrl. The scan session is created before execute starts, so the caller can send the link immediately.

{ "runId": "run_91", "workflowInstanceId": "run_91", "scanSessionId": "scan_91", "scanUrl": "https://scan.ollie.health/org_1/loop_1/scan_91" }

From the UI

Open the loop and click Run. The same JSON becomes event.body.

From another file

A tool or another workflow starts a run with trigger, and gets the same response. See Calling a workflow.

Last updated on