How input is extracted:
POST/PUT/PATCHwith JSON body → body becomes the inputGET→ query parameters become the input- Default values are merged underneath (request data overrides)
Response modes
Raw mode
In raw mode the function’s return value becomes the response body: a dict or list is returned as JSON, a string astext/plain. This is required for providers that expect a specific response body, e.g. Slack’s Events API url_verification handshake:
_status, _headers, and _body:
Agent targets
A webhook can trigger an agent directly, without a bridge function. The request payload is rendered throughmessage_template (Jinja2) and sent to the agent as a user message. Undefined template variables render as empty strings — an unexpected payload shape never fails the webhook. If any variable was undefined, the rendered message is delivered with the full raw payload appended (so the agent keeps both your instructions and the data); a template that renders fully empty falls back to the raw payload alone. For multi-event sources (e.g. GitHub issues + PRs + comments), reference only fields present in every payload variant, or guard with {% if x is defined %}.
With a session_key_template, repeated events that render the same key continue the same conversation (like the session_key on POST /agents/{ns}/{name}/invoke) — e.g. all events for one Jira issue or one Slack thread share a chat. Without it, each delivery starts a fresh chat.
syncwaits for the agent’s reply and returns{"success": true, "chat_id": ..., "reply": "..."}asyncreturns202with{"chat_id": ..., "job_id": ...}— use this for provider webhooks- For authenticated webhooks the caller needs chat permission on the target agent (
sinas.agents/{ns}/{name}.chat); unauthenticated webhooks run as the webhook owner - Deduplication works identically for both target types
functionName: namespace/name); responseMode: raw is available for them as well.
Pipeline targets
A webhook can fire a pipeline: the request payload (merged overdefaultValues) becomes the pipeline’s run input, executed as the webhook’s owner.
syncruns the pipeline inline (bounded by the pipeline’ssyncTimeoutSeconds) and returns{"success": true, "run_id": ..., "output": ...}; a failed run returns500with therun_idof the replayable run recordasyncreturns202with{"run_id": ...}— use this for provider webhooks and slow pipelines (e.g. ones containing agent steps)rawis not supported for pipeline targets- For authenticated webhooks the caller must own the webhook and hold
sinas.pipelines/{ns}/{name}.run - A webhook event is a single occurrence, so
perUserpipelines do not fan out here — that behavior belongs to schedules and manual?allUsers=trueruns