Flows
Node Types
Triggers

Trigger Nodes

Trigger nodes start workflow execution. Every flow must begin with exactly one trigger.

Available Triggers

Interface Event
Called from frontend code
Webhook
Receive HTTP requests
Schedule
Run on a schedule
Manual Trigger
Start manually
Inbound Call
Receive phone calls
SMS Received
Receive SMS messages

Interface Event Trigger

Interface Event

The primary way to create backend functions callable from your frontend via callFlow() or executeFlow().

Configuration:

FieldTypeDescription
inputParamsarrayParameters 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

Webhook

Receive HTTP requests from external services (Stripe, GitHub, Zapier, etc.).

Configuration:

FieldTypeDescription
respondImmediatelybooleanReturn 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

Schedule

Run workflows on a recurring schedule.

Configuration:

FieldTypeDescription
scheduleTypeselectinterval, cron, daily, or weekly
intervalValuenumberInterval value (for interval type)
intervalUnitselectminutes, hours, or days
cronExpressionstringCron format: minute hour day month weekday
dailyTimestringTime in 24h format (e.g., 09:00)
weeklyDayselectDay of week (0-6, Sunday-Saturday)
timezonestringTimezone (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

Manual Trigger

Start workflows manually with custom input data. Useful for testing and admin operations.

Configuration:

FieldTypeDescription
inputParamsarrayExpected 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

Inbound Call

Trigger workflow when a phone call is received on your Twilio number.

Configuration:

FieldTypeRequiredDescription
phoneNumberIdstringYesTwilio phone number SID
agentIdstringYesElevenLabs 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

SMS Received

Trigger workflow when an SMS message is received on your Twilio number.

Configuration:

FieldTypeRequiredDescription
phoneNumberstringYesTwilio 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:

PatternDescription
{{ $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: