LoomCycle Webhook
AI-generatedSummary
Manages loomcycle inbound webhook definitions (create, fork, get, list versions, retire) by calling the loomcycle WebhookDef substrate endpoint (POST /v1/_webhookdef). The operation parameter selects the action, and the node returns the server's response under result.
Inputs
- operation (required) — Create, Fork, Get, List Versions, or Retire. The other fields depend on this choice.
- name (required) — Webhook definition name, which is also the endpoint path segment for inbound POSTs. Used by Get, List, Create and Retire.
- defId — Retire only. A specific def_id to retire. If empty, the active version of the name is retired.
- parentDefId (required) — Fork only. The def_id to branch from. The new row inherits any fields the overlay doesn't set.
- agent — Create only. The agent to spawn when the webhook fires. Options load from loomcycle. Leave empty if the webhook publishes to a channel.
- channel — Create only. The channel that receives the inbound payload. Options load from loomcycle.
- enabled — Create only. Whether loomcycle serves the endpoint. Default true.
- defDescription — Create and Fork. A description of this version, for lineage auditing.
- metadata — Create and Fork. A JSON object of static, non-secret metadata. It is passed to the spawned agent as trusted and sent as overlay.metadata. Invalid JSON raises an error, and an empty object is omitted.
- userCredentials — Create and Fork. Name/value pairs sent as overlay.user_credentials. Values must be template strings such as ${LOOMCYCLE_X}, not plaintext secrets.
- overlay — Create and Fork. Advanced JSON with auth, rate_limit, payload_mapping and sync_response. On Fork it is the diff merged onto the parent. On Create, agent, channel, enabled, metadata and credentials override matching keys in it.
- promote — Create and Fork. Whether to promote the new version to active so the endpoint goes live. Default true.
Output shape
One output item per input item, with the loomcycle response in json.result. For Get it is the active row. For List Versions it is the version lineage for the name. For Create and Fork it is the new definition row. For Retire it is the server's retire response.
Auth secrets (signing_secret_env, bearer_token_env) are environment variable names that loomcycle resolves from its own environment. Errors are wrapped as NodeApiError, for example 401, 400, or 422 when the substrate refuses the call. With Continue On Fail enabled, an item with an
errorfield is returned instead. The exact row fields come from the server and are not defined in this node's code.
Examples
Example 1: Create a webhook that spawns an agent on each inbound POST
Operation=Create, Name=github-events, Agent=triage-agent, Enabled=true, Promote=true, Overlay={"auth":{"kind":"bearer","bearer_token_env":"GH_WEBHOOK_TOKEN"}}
Example 2: Change the rate limit on an existing webhook version
Operation=Fork, Parent Def ID=
Example 3: Turn off an endpoint
Operation=Retire, Name=github-events, Def ID left empty