SWIRLS_
ReferenceSDKClient

Triggers

SDK reference for triggers — Connect resources (forms, webhooks, schedules, agents) to graphs so they execute automatically.

Connect resources (forms, webhooks, schedules, agents) to graphs so they execute automatically.

createTrigger

Create a trigger that connects a resource to a graph, so when the resource fires (form submission, webhook call, schedule tick, or agent tool call), the graph executes. Requires resourceType (form, webhook, schedule, or agent), resourceId (the resource's ID), and graphId (the target graph).

POST

Usage:

const result = await swirls.client.triggers.createTrigger({
  projectId: '...',
  graphId: '...',
  resourceType: '...',
  resourceId: '...',
})

Input:

ParameterTypeRequiredDescription
idstringNo
projectIdstringYes
graphIdstringYes
resourceType"form" | "webhook" | "schedule" | "agent"Yes
resourceIdstringYes
enabledbooleanNo

Output:

FieldTypeDescription
idstring
projectIdstring
graphIdstring
resourceType"form" | "webhook" | "schedule" | "agent"
resourceIdstring
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

getTrigger

Get a trigger by ID

GET

Usage:

const result = await swirls.client.triggers.getTrigger({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
graphIdstring
resourceType"form" | "webhook" | "schedule" | "agent"
resourceIdstring
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

updateTrigger

Update a trigger

PUT

Usage:

const result = await swirls.client.triggers.updateTrigger({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
resourceIdstringNo
graphIdstringNo
enabledbooleanNo

Output:

FieldTypeDescription
idstring
projectIdstring
graphIdstring
resourceType"form" | "webhook" | "schedule" | "agent"
resourceIdstring
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

deleteTrigger

Delete a trigger

DELETE

Usage:

const result = await swirls.client.triggers.deleteTrigger({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

listTriggers

List all triggers in a project. Triggers connect resources (forms, webhooks, schedules, agents) to graphs.

GET

Usage:

const result = await swirls.client.triggers.listTriggers({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
graphIdstringNo
resourceIdstringNo
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

listSchemaIncompatibilities

GET

Usage:

const result = await swirls.client.triggers.listSchemaIncompatibilities({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

executeTriggers

Execute all enabled triggers for a resource (form, webhook, or schedule). The resourceId is the ID of the form/webhook/schedule. The "input" object should match the resource's schema — use get_form or get_webhook to inspect the schema first. Returns execution IDs for each triggered graph.

POST

Usage:

const result = await swirls.client.triggers.executeTriggers({
  resourceId: '...',
})

Input:

ParameterTypeRequiredDescription
resourceIdstringYes
resourceType"form" | "webhook" | "schedule"No
inputobjectNo

Output:

FieldTypeDescription
executionIdsstring[]

On this page