Overview
Pipeline triggers are automated scheduling mechanisms that determine when and how data pipelines should run in Mage. A single pipeline can have multiple triggers, each with different configurations for various use cases like production runs, testing, or data backfills.Key Benefits of Pipeline Triggers:
- Automated execution - Run pipelines without manual intervention
- Flexible scheduling - Support for cron expressions, API calls, and event-based triggers
- Environment management - Different trigger configurations for dev, staging, and production
- Resource optimization - Control when pipelines consume compute resources
- Monitoring and SLA - Built-in performance tracking and alerting
Pipeline Schedule and Trigger are the same thing in Mage. You may see either term used throughout the product.
Trigger Types
Schedule triggers
Schedule triggers are the most common type, designed for recurring data pipeline execution at predetermined intervals. They’re perfect for ETL processes, data updates, and regular analytics jobs. Available scheduling frequencies include:- Run exactly once - Execute the pipeline once and then disable the trigger
- Hourly - Run every hour
- Daily - Run once per day
- Weekly - Run once per week
- Monthly - Run once per month
- Always on - Immediately create new pipeline run when previous pipeline run completes (either succeeds or fails)
- Custom (cron syntax) - Use cron expressions for advanced scheduling patterns
Custom frequency allows you to use cron syntax for advanced scheduling patterns. This gives you complete control over when your pipeline runs.
Common cron examples
Here are some common cron patterns you can use with custom frequency:[minute] [hour] [day(month)] [month] [day(week)]
Timezone behavior: If you have the
display_local_timezone
setting enabled, the local cron expression will match your local timezone only if the minute and hour values are single values without any special characters (comma, hyphen, or slash). You can still use cron expressions with special characters for the minute/hour values, but they will be based in UTC time.Use online cron expression generators or cron documentation to create more complex scheduling patterns that fit your specific needs.
API triggers
API triggers enable on-demand pipeline execution through HTTP requests. They’re ideal for webhook integrations, external system triggers, and manual pipeline execution from external applications. For more details, refer to the API Trigger documentation. Use cases for API triggers:- Webhook integrations with external services
- Manual pipeline execution from external applications
- Event-driven data processing
- Integration with CI/CD pipelines
Event triggers
An event-type trigger instructs the pipeline to run whenever a specific event occurs. For example, you can configure a pipeline to run when a database query completes or when a new object is created in Amazon S3 or Google Cloud Storage. You can also trigger a pipeline using a custom event by making aPOST
request to the /api/events
endpoint with your event payload:
Check out this tutorial on how to create an event trigger.
How to Create and Manage Pipeline Triggers
Creating a New Trigger
To create a new trigger for your pipeline:- Navigate to your pipeline in the Mage UI
- Click the Triggers tab in the pipeline view
- Direct URL:
/pipelines/[pipeline_uuid]/triggers
- Direct URL:
- Click + New trigger button
- Select the trigger type (Schedule or API)
- Configure the trigger settings based on the type you selected
- Click Save changes to create the trigger
Trigger storage: Triggers created via the UI are stored in the database. For environment synchronization and version control, you can save triggers in code to sync them across different environments.
Trigger configuration fields
When creating or editing a trigger, you’ll see the following configuration fields: Basic settings:- Name - A descriptive name for your trigger
- Description - Optional description to explain the trigger’s purpose
- Tags - Add or search tags to organize and categorize your triggers
- Frequency - Choose from predefined options (Hourly, Daily, Weekly, Monthly) or select Custom for CRON syntax
- Start date and time - When the trigger should begin running
- Enable landing time - Instead of starting at a specific time, schedule runs to finish by a specified time
- Runtime variables - Override pipeline variables for this specific trigger
- Run settings - Configure timeouts, SLA, and failure handling
- Advanced settings - Additional trigger-specific configurations
Viewing and Monitoring Triggers
Pipeline-Specific Trigger Management
To view all triggers for a specific pipeline:- Navigate to your pipeline in the Mage UI
- Click the Triggers tab
- Direct URL:
/pipelines/[pipeline_uuid]/triggers
- Direct URL:
- You’ll see a comprehensive table listing all configured triggers with the following information:
Project-Wide Trigger Dashboard
To view all triggers across your entire project:- Go to the Mage homepage
- Click Triggers in the left navigation menu
- Direct URL:
/triggers
- Direct URL:
- You’ll see all triggers from all pipelines in your project
- Active - Toggle switch showing if the trigger is enabled/disabled
- Logs - Icon to access trigger execution logs
- Name - The trigger name (clickable link with arrow icon for code-defined triggers)
- Type - Trigger type (schedule, API, etc.)
- Frequency - How often the trigger runs (e.g., @once, @daily)
- Status - Current status of the trigger
- Next - Scheduled time for the next execution (with info icon for details)
- Runs - Total number of pipeline runs initiated by this trigger
- Tags - Associated tags for organization
- Created - Timestamp when the trigger was created (with info icon for details)
- From trigger list: Use the toggle switch in the “Active” column to enable or disable a trigger
- From trigger detail page: Navigate to
/pipelines/[pipeline_uuid]/triggers/[trigger_id]
and use the “Disable trigger” button - Disabled triggers: Will not run automatically but remain configured for future use
- Enabled triggers: Will run according to their configured schedule or trigger conditions
- Run once button: Click the “Run@once” button in the trigger list or detail page to manually trigger a pipeline run
- Testing purpose: Use this to test your trigger configuration before enabling it for automatic execution
- Immediate execution: The pipeline will start running immediately when you click the button
- Historical data processing: Create backfill triggers to process historical data for a specific date range
- One-time execution: Backfill triggers run once and then disable themselves after completion
- Data gap filling: Use backfills to fill in missing data or reprocess data with updated logic
- Mage OSS: Click the delete (trash) icon in the Actions column to delete a trigger
- Mage Pro: Right-click on a trigger row and select Delete from the context menu
Advanced Trigger Configuration
Run Settings and Performance Optimization
Timeout configuration
- Set a timeout for each run of this trigger (optional)
- Configure a timeout in seconds for pipeline runs initiated by this trigger
- If a run exceeds the timeout, it will be marked with the specified timeout status
- Status for runs that exceed the timeout (default: failed)
- Choose how to handle runs that exceed the configured timeout
- Options typically include: failed, cancelled, or warning
SLA configuration
- Configure trigger SLA
- Set up Service Level Agreement monitoring for your trigger
- Define expected completion time with configurable time units (minutes, hours, days)
- Helps monitor trigger performance against business requirements
Additional trigger settings
- Override runtime variables
- You can override the runtime variables defined in the pipeline to use different values for different triggers.
- This option only appears if you have runtime variables defined in the pipeline.
- Benefits: Allows you to run the same pipeline with different configurations for different use cases (e.g., different data sources, environments, or processing parameters) without creating separate pipelines.
- Keep running pipeline even if blocks fail
- When enabled, the pipeline continues running even if individual blocks fail
- The pipeline will continue running blocks that are not dependent on the failed blocks until completion
- (Schedule triggers only) Skip run if previous run still in progress
- When enabled, the scheduler will not start a new run if a previous run for this trigger is still in progress.
- (Schedule triggers only) Create initial pipeline run if start date is before current execution periodAvailable starting in v0.9.62
- When enabled, this creates an initial pipeline run if the schedule’s execution date is after its start datetime but before the current time.
- Example: If current time is
1/4/24 12:00 UTC
and you create a daily trigger with start date1/3/24 12:00 UTC
, a pipeline run with execution date2024-01-04 00:00
is immediately created.
Frequently Asked Questions
What is a trigger in Mage?
A trigger is a set of instructions that determine when or how a pipeline should run. There are three types of triggers in Mage: Schedule, Event, and API.- Schedule: Runs pipelines on a set interval (e.g., hourly, daily, weekly, monthly, or custom cron)
- Event: Runs pipelines in response to specific events (e.g., file arrival, database update)
- API: Runs pipelines when a specific API endpoint is called, optionally with runtime variables
How do I create a trigger for my pipeline?
You can create triggers via the Mage UI or by defining them in atriggers.yaml
file within your pipeline folder. In the UI, go to the pipeline editor, select “Triggers,” and click “New trigger.” In code, add your trigger configuration to pipelines/[pipeline_uuid]/triggers.yaml
.