Trigger Nodes
Trigger nodes start workflow execution. Every flow must begin with exactly one trigger.
Available Triggers
Interface Event Trigger
The primary way to create backend functions callable from your frontend via callFlow() or executeFlow().
Configuration:
| Field | Type | Description |
|---|---|---|
inputParams | array | Parameters the flow expects from the caller |
Input Parameter Format:
{
"inputParams": [
{ "name": "email", "type": "string", "required": true },
{ "name": "category", "type": "string", "required": false }
]
}Supported Types: string, number, boolean, object, array
Accessing Input Data:
{{ $input.fieldName }}- Access a specific input field{{ $input }}- Access the entire input object
Example Flow:
{
"id": "interface_event_trigger-1",
"type": "interface_event_trigger",
"label": "Get Products",
"config": {
"inputParams": [
{ "name": "category", "type": "string", "required": false }
]
}
}Calling from Interface:
// Server-side (in page.tsx)
const products = await executeFlow('get_products', { category: 'electronics' });
// Client-side (in 'use client' component)
const result = await callFlow('get_products', { category: 'electronics' });Webhook Trigger
Receive HTTP requests from external services (Stripe, GitHub, Zapier, etc.).
Configuration:
| Field | Type | Description |
|---|---|---|
respondImmediately | boolean | Return 200 OK immediately (default: true) |
Output Variables:
{{ $input.body }}- Parsed request body (JSON){{ $input.headers }}- Request headers object{{ $input.query }}- URL query parameters{{ $input.method }}- HTTP method (POST, GET, etc.)
Example:
{
"id": "webhook_trigger-1",
"type": "webhook_trigger",
"label": "Stripe Webhook",
"config": {
"respondImmediately": false
}
}Getting Your Webhook URL:
node bin/lux-cli/lux.js workflows webhook-url <flow-id>Use Cases: Payment webhooks, GitHub events, form submissions, IoT events.
Schedule Trigger
Run workflows on a recurring schedule.
Configuration:
| Field | Type | Description |
|---|---|---|
scheduleType | select | interval, cron, daily, or weekly |
intervalValue | number | Interval value (for interval type) |
intervalUnit | select | minutes, hours, or days |
cronExpression | string | Cron format: minute hour day month weekday |
dailyTime | string | Time in 24h format (e.g., 09:00) |
weeklyDay | select | Day of week (0-6, Sunday-Saturday) |
timezone | string | Timezone (default: UTC) |
Output Variables:
{{ $input.triggeredAt }}- ISO timestamp when triggered{{ $input.scheduleName }}- Name of the schedule
Examples:
Every 5 minutes:
{
"scheduleType": "interval",
"intervalValue": 5,
"intervalUnit": "minutes"
}Daily at 9am:
{
"scheduleType": "daily",
"dailyTime": "09:00",
"timezone": "America/New_York"
}Cron (weekdays at 6pm):
{
"scheduleType": "cron",
"cronExpression": "0 18 * * 1-5"
}Manual Trigger
Start workflows manually with custom input data. Useful for testing and admin operations.
Configuration:
| Field | Type | Description |
|---|---|---|
inputParams | array | Expected input parameters |
Example:
{
"id": "manual_trigger-1",
"type": "manual_trigger",
"label": "Manual Start",
"config": {
"inputParams": [
{ "name": "userId", "type": "string", "required": true },
{ "name": "action", "type": "string", "required": true }
]
}
}Inbound Call Trigger
Trigger workflow when a phone call is received on your Twilio number.
Configuration:
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumberId | string | Yes | Twilio phone number SID |
agentId | string | Yes | ElevenLabs agent ID to handle the call |
Output Variables (after call completes):
{{ $input.callSid }}- Twilio call SID{{ $input.from }}- Caller's phone number{{ $input.to }}- Called phone number{{ $input.transcript }}- Full conversation transcript{{ $input.data_collection_results }}- Collected data from the call{{ $input.call_duration_secs }}- Call duration in seconds
Example:
{
"id": "inbound_call_trigger-1",
"type": "inbound_call_trigger",
"label": "Support Line",
"config": {
"phoneNumberId": "PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"agentId": "agent_abc123"
}
}Setting Up:
# List Twilio numbers
node bin/lux-cli/lux.js voice-agents twilio-numbers
# Configure inbound handling
node bin/lux-cli/lux.js voice-agents configure-inbound +15551234567 <flow-id>SMS Received Trigger
Trigger workflow when an SMS message is received on your Twilio number.
Configuration:
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber | string | Yes | Twilio phone number to receive SMS |
Output Variables:
{{ $input.message_body }}- The SMS message content{{ $input.sending_number }}- Phone number that sent the SMS{{ $input.receiving_number }}- Your Twilio number{{ $input.received_timestamp }}- When the message was received (ISO 8601)
Example:
{
"id": "sms_received_trigger-1",
"type": "sms_received_trigger",
"label": "SMS Auto-Responder",
"config": {
"phoneNumber": "+14155551234"
}
}Expression Syntax Reference
Access data in your flows using these patterns:
| Pattern | Description |
|---|---|
{{ $input }} | Full input object from trigger |
{{ $input.fieldName }} | Specific field from input |
{{ $node.nodeId.data }} | Output from a previous node |
{{ $node.nodeId }} | Full output object from previous node |
{{ $now }} | Current ISO timestamp |
{{ $env.SECRET_NAME }} | Environment variable/secret |
See Also: