An action is a single unit of work exposed by a connector — for example, “Create Contact” or “Send Email”. Actions are defined withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/prismatic-io/spectral/llms.txt
Use this file to discover all available pages before exploring further.
action() and collected in the actions field of component().
ActionDefinition type
display field uses ActionDisplayDefinition:
The perform function
Every action must have aperform function with this signature:
Context object
Thecontext parameter provides platform services and metadata:
| Field | Type | Description |
|---|---|---|
logger | ActionLogger | Structured logger (see below) |
instanceState | Record<string, unknown> | Flow-specific key/value store persisted between executions |
crossFlowState | Record<string, unknown> | Key/value store shared across all flows of an instance |
executionState | Record<string, unknown> | Key/value store scoped to the current execution only |
integrationState | Record<string, unknown> | Key/value store shared across all flows and all versions of an integration |
configVars | TConfigVars | Config variable values set by the integration builder |
customer | CustomerAttributes | Attributes of the customer the instance belongs to |
instance | InstanceAttributes | Attributes of the currently running instance |
user | UserAttributes | Attributes of the user associated with a user-level config |
integration | IntegrationAttributes | Attributes of the integration being executed |
flow | FlowAttributes | Attributes of the currently executing flow |
stepId | string | Unique ID for this step in the integration |
executionId | string | Unique ID for this specific execution |
webhookUrls | Record<string, string> | Webhook URLs for all flows on this instance |
webhookApiKeys | Record<string, string[]> | Webhook API keys for all flows on this instance |
invokeUrl | string | URL used to invoke the current execution |
startedAt | string | UTC timestamp when execution started |
invokeFlow | FlowInvoker | Function to trigger another flow programmatically |
components | object | Other component actions registered via componentRegistry |
debug | DebugContext | Tools for profiling time and memory usage |
isSimulatedTestExecution | boolean | True when running with simulated test data |
Logger
Thecontext.logger object exposes structured logging methods that integrate with Prismatic’s execution logs:
ActionPerformReturn
Allperform functions must return a Promise that resolves to an ActionPerformReturn.
Standard return
Branching return
WhenallowsBranching: true, the return type must include a branch field:
Complete example
The following action makes an authenticated API call, persists state, and returns structured data:Flow control fields
terminateExecution
SetterminateExecution: true to stop the flow immediately after this action completes, regardless of any subsequent steps:
breakLoop
SetbreakLoop: true to exit from an enclosing loop step:
