Example requests
- “Give our backend a URL it can call with an order id to start the refund review workflow.”
- “Add a webhook trigger to the lead-routing workflow that takes an email and a company name.”
- “Let our CI pipeline start the release-notes workflow when a deploy finishes.”
How a webhook trigger is defined
A webhook trigger has anid, the type webhook, and an optional label and input. It has no config, and its URL and credential never appear in the definition.
Getting the URL and credential
Each webhook trigger has one URL and one bearer token. The token is shown once, so copy both into the system that will call the workflow, such as its secrets manager, before you close the dialog.1
Add the trigger
In the workflow editor, add a trigger and choose Webhook. Major creates the URL right away and shows the URL and token. Copy both, confirm you’ve saved the token, and click Done.If the trigger was added in JSON, through the Platform Agent, MCP, or the CLI, its URL is created when you publish. Open the workflow in the editor afterwards and click View credential on the trigger to generate and reveal the token.
2
Publish
The URL doesn’t accept calls until the workflow is published. Before that, calls are rejected.
3
Call the URL
Send a
POST with the token in the Authorization header.Calling the webhook
- The body must be JSON, sent with
Content-Type: application/json, and at most 1 MB. - A successful call returns
200after the run has been created. - An unknown URL, a missing or wrong token, or an unpublished trigger all return
404, so the response never reveals whether a trigger exists. - A body that isn’t valid JSON returns
400, and a body over 1 MB returns413.
<webhook-id> in it is generated by Major and is not the trigger’s id in the definition. Each call starts one run of the published version, which appears in the workflow’s run history.
Shaping the input
By default, the JSON body becomestrigger.input as is, so the call above gives the workflow trigger.input.order_id and trigger.input.amount. The body must be a JSON object in this case.
To pick or rename fields, set input on the trigger. Each value is a JSON literal or a { "$expr": "..." } CEL expression, and expressions can only read the body, as event.json:
input_schema, the input is validated against it. When the projection fails or the input doesn’t validate, the call still returns 200, and the run is recorded as failed with the reason. See State and input.
Removing a webhook
Removing a published webhook trigger takes effect when you publish: the URL keeps working until then, and publishing retires it and revokes its token. Removing a trigger that was never published retires it immediately. The credential acts on behalf of the workflow’s publisher at the time it was created. If that person loses access to the workflow or leaves the organization, calls are rejected.Next steps
Connector events
Start a workflow from events in services you’ve connected.
State and input
Validate and use the webhook’s input.