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:
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#
/api/workflow-hooks/{token}curl --fail-with-body "$JEMERO_WORKFLOW_HOOK_URL" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d '{ "email": "[email protected]", "plan": "team" }'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: '[email protected]', plan: 'team' }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(response.status, await response.json());import os
import requests
response = requests.post(
os.environ["JEMERO_WORKFLOW_HOOK_URL"],
headers={"Idempotency-Key": "order-1042"},
json={"email": "[email protected]", "plan": "team"},
timeout=30,
)
response.raise_for_status()
print(response.status_code, response.json()){ "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#
| Value | Contents |
|---|---|
trigger.body | The parsed JSON body. A body that isn't JSON arrives as { "text": "…" }. For GET, or an empty body, {}. |
trigger.query | The 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:
{ "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#
| Limit | Answer when over it |
|---|---|
| 300 requests a minute for each workflow, counting duplicates | 429 with a Retry-After header, in seconds |
| 5,000 workflow runs an hour for the whole workspace | 429 Too many runs this hour., without Retry-After |
| 100 runs started a minute for the whole workspace | accepted; extra runs wait their turn |
On a 429, wait and try again, with increasing delays if there is no Retry-After.
Errors#
| Status | Meaning |
|---|---|
404 Workflow not found | The token is wrong, or the workflow isn't active or no longer has a Webhook trigger. |
413 | The body is too large. |
429 | See limits above. |