Saltar a contenido

🤖 Explicar con IA

Workflow Triggers

Triggers define when a workflow executes. Workflows supports three trigger types to fit different automation needs.

Trigger Types

Type Use Case Example
Manual On-demand execution by a user Generate a report when needed
Scheduled Recurring execution on a schedule Daily data sync at 9 AM
Webhook Triggered by external events Process incoming order data

Manual Trigger

Execute workflows on demand from the Workflows dashboard.

Configuration:

No additional configuration required.

Usage:

  1. Navigate to the workflow
  2. Click Run Now
  3. View execution results in the logs

Best for:

  • Ad-hoc tasks
  • Testing workflows
  • Operations that don’t follow a schedule

Scheduled Trigger

Run workflows automatically on a recurring schedule using cron expressions.

Configuration:

Field Description Example
Schedule Cron expression defining the schedule 0 9 * * 1-5 (weekdays at 9 AM)
Timezone Timezone for schedule evaluation America/Costa_Rica

Cron Expression Format:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *

Common Schedules:

Schedule Cron Expression
Every hour 0 * * * *
Daily at midnight 0 0 * * *
Daily at 9 AM 0 9 * * *
Weekdays at 9 AM 0 9 * * 1-5
First day of month 0 0 1 * *
Every 15 minutes */15 * * * *

Best for:

  • Regular data synchronization
  • Scheduled reports
  • Periodic cleanup tasks
  • Automated reminders

Webhook Trigger

Trigger workflows from external systems via HTTP POST requests.

Configuration:

Field Description
Webhook URL Unique URL generated for the workflow
Secret Optional secret for request validation

Usage:

  1. Create a workflow with a webhook trigger
  2. Copy the generated webhook URL
  3. Configure your external system to POST to this URL
  4. Include data in the request body as JSON

Request Format:

{
  "event": "order.created",
  "data": {
    "order_id": "12345",
    "customer_email": "customer@example.com",
    "total": 99.99
  }
}

Accessing Webhook Data:

Reference webhook payload data in subsequent steps:

{{Trigger.data.order_id}}
{{Trigger.data.customer_email}}

Security:

  • Each webhook URL is unique and unguessable
  • Optionally validate requests using the secret
  • Webhook URLs can be regenerated if compromised

Best for:

  • Reacting to external events
  • Integrating with systems that support webhooks
  • Processing incoming data in real-time
  • Event-driven architectures

Execution Context

Each trigger provides context data available to subsequent steps:

Trigger Type Context Data
Manual User who triggered, timestamp
Scheduled Scheduled time, actual execution time
Webhook Full request payload, headers, timestamp

Access context data using the {{Trigger.field}} syntax in action parameters.

Best Practices

  1. Use scheduled triggers for regular tasks — Don’t rely on manual execution for recurring operations
  2. Test webhooks thoroughly — Use the execution logs to verify payload structure
  3. Set appropriate schedules — Avoid overly frequent schedules that may hit rate limits
  4. Document trigger purpose — Use workflow descriptions to explain why the trigger is configured this way
  5. Monitor execution logs — Check for failed runs and adjust trigger configuration as needed

What’s Next

  • Actions — Configure what happens when a workflow runs
  • Templates — See examples of trigger configurations in templates

AĂşn con dudas? Pregunta en Discord o explore tutoriales