Inbound workflow webhooks

Start a Jemero workflow by calling its webhook URL from another system.

On this page

A workflow whose trigger is Webhook has its own URL. Calling it starts a run of the workflow. This goes into Jemero, and is separate from the webhooks Jemero sends.

Get the URL#

Build a workflow with the Webhook trigger and activate it. The editor shows its URL:

URL
https://app.jemero.com/api/workflow-hooks/{token}

This URL isn't under your workspace's API base URL, and it takes no API key.

Call it#

POST/api/workflow-hooks/{token}
cURL
curl --fail-with-body "$JEMERO_WORKFLOW_HOOK_URL" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042" \
  -d '{ "email": "ada@example.com", "plan": "team" }'
Node.js
const response = await fetch(process.env.JEMERO_WORKFLOW_HOOK_URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'order-1042',
  },
  body: JSON.stringify({ email: 'ada@example.com', plan: 'team' }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(response.status, await response.json());
Python
import os
import requests

response = requests.post(
    os.environ["JEMERO_WORKFLOW_HOOK_URL"],
    headers={"Idempotency-Key": "order-1042"},
    json={"email": "ada@example.com", "plan": "team"},
    timeout=30,
)
response.raise_for_status()
print(response.status_code, response.json())
Response 202
{ "runId": "b27796d8-1b07-4ae4-95aa-3d5769712e69" }

202 means a run was created, not that it succeeded. Check the workflow's runs in Jemero.

GET also starts a run, using only the query string. Take care: link previewers and scanners send GET requests, so don't share the URL where they might follow it.

What the workflow receives#

ValueContents
trigger.bodyThe parsed JSON body. A body that isn't JSON arrives as { "text": "…" }. For GET, or an empty body, {}.
trigger.queryThe query string's parameters.

For the call above, a step can use {{trigger.body.email}}.

The body can be up to 1,000,000 characters. A larger one answers 413.

Safe retries#

Send an Idempotency-Key header with a value that identifies the event, such as an order number or the sender's delivery ID. If a run was already started with that key for this workflow in the last 24 hours, Jemero starts nothing and answers:

Response 200
{ "runId": "b27796d8-1b07-4ae4-95aa-3d5769712e69", "duplicate": true }

Only the first 200 characters of the key are used. The body isn't compared: the same key with different data is still treated as a duplicate.

Limits#

LimitAnswer when over it
300 requests a minute for each workflow, counting duplicates429 with a Retry-After header, in seconds
5,000 workflow runs an hour for the whole workspace429 Too many runs this hour., without Retry-After
100 runs started a minute for the whole workspaceaccepted; extra runs wait their turn

On a 429, wait and try again, with increasing delays if there is no Retry-After.

Errors#

StatusMeaning
404 Workflow not foundThe token is wrong, or the workflow isn't active or no longer has a Webhook trigger.
413The body is too large.
429See limits above.