Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ThecreateExecutor function creates event-driven handlers that automatically respond to record changes, resolver executions, schedules, or incoming webhooks. Executors support multiple operation types including functions, webhooks, GraphQL queries, and workflows.
Function Signature
Parameters
Unique executor name globally across your entire application.
Optional description of the executor’s purpose.
Event that triggers the executor. See Trigger Types for available options.
Action to perform when triggered. See Operation Types for available options.
Trigger Types
Record Triggers
Fire when records are created, updated, or deleted in TailorDB:recordCreatedTrigger
The TailorDB type to monitor for record creation events.
Optional filter function. Receives
{ newRecord, workspaceId, appNamespace, typeName, env, actor }.recordUpdatedTrigger
The TailorDB type to monitor for record update events.
Optional filter function. Receives
{ newRecord, oldRecord, workspaceId, appNamespace, typeName, env, actor }.recordDeletedTrigger
The TailorDB type to monitor for record deletion events.
Optional filter function. Receives
{ oldRecord, workspaceId, appNamespace, typeName, env, actor }.scheduleTrigger
Fires on a cron schedule:Standard cron expression (5 fields: minute, hour, day, month, weekday).
IANA timezone name (e.g., “America/New_York”, “Europe/London”, “Asia/Tokyo”). Defaults to UTC.
incomingWebhookTrigger
Fires when an external webhook is received:{ body, headers, method, rawBody, env } to the operation.
resolverExecutedTrigger
Fires when a resolver is executed:The resolver to monitor for execution events.
Optional filter function. Receives
{ success, result?, error?, resolverName, workspaceId, appNamespace, env, actor }.Additional Triggers
Executors also support triggers for IdP users and auth access tokens:idpUserCreatedTrigger()- IdP user creationidpUserUpdatedTrigger()- IdP user updateidpUserDeletedTrigger()- IdP user deletionauthAccessTokenIssuedTrigger()- Access token issuedauthAccessTokenRefreshedTrigger()- Access token refreshedauthAccessTokenRevokedTrigger()- Access token revoked
Operation Types
Function Operation
Execute JavaScript/TypeScript functions:Identifies this as a function operation.
Function to execute. Receives trigger-specific arguments (e.g.,
{ newRecord } for recordCreatedTrigger).Job Function Operation
For long-running operations that run asynchronously with extended execution times:Use
jobFunction for operations that may take longer than a few seconds. See Job Function Operation for details.Webhook Operation
Call external webhooks with dynamic data:Identifies this as a webhook operation.
Function that returns the webhook URL. Receives trigger arguments.
HTTP headers to include. Values can be strings or vault references
{ vault: "name", key: "key" }.Function that returns the request body. Receives trigger arguments.
GraphQL Operation
Execute GraphQL queries and mutations:Identifies this as a GraphQL operation.
Optional app name to target. Defaults to current app.
GraphQL query or mutation string.
Function that returns GraphQL variables. Receives trigger arguments.
Optional machine user for authentication. See Authentication for Operations.
Workflow Operation
Trigger workflows from executors:Identifies this as a workflow operation.
The workflow to trigger (imported from workflow files).
Workflow arguments. Can be a static object or function receiving trigger arguments.
Optional machine user for authentication. See Authentication for Operations.
Authentication for Operations
GraphQL and Workflow operations can specify anauthInvoker to execute with machine user credentials:
Examples
Record Created Trigger with Function
executors/userCreated.ts
Schedule Trigger with Workflow
executors/dailyWorkflow.ts
Incoming Webhook Trigger
executors/testWebhook.ts
GraphQL Operation
executors/salesOrderCreated.ts
Definition Rules
See Also
- Tailor Platform Executor Guide - Official documentation
- createWorkflow - Trigger workflows from executors
- createResolver - Use resolvers with
resolverExecutedTrigger