Automate your Flows
In this guide, you'll learn how to use Ascend's Automation framework to trigger Flows in response to real-time system Events and Sensors. You'll create responsive, intelligent pipelines that run precisely when they're needed.
What you'll learn
- How to create Automations using both the UI and file-based approaches
- How to configure different types of triggers (Sensors and Events)
- How to implement different Action types
- How to build custom Python Automations
Prerequisites
- At least one Ascend Flow
- Deployment (Automations need to be deployed to run)
- Python knowledge (if building custom Sensors or Actions)
Automation structure
Every Automation follows this structure:
automation:
name: <automation_name>
enabled: true # Set to false to disable
triggers:
sensors: # Time or condition-based triggers
- ...
events: # Event-based triggers
- ...
actions: # What to do when triggered
- ...
At least one trigger (Sensor or Event) must be specified.
Sensors
Sensors are time-based or condition-based triggers.
Timer Sensor
Triggers on a schedule using cron expressions:
sensors:
- type: timer
name: hourly-trigger
config:
schedule:
cron: '0 * * * *' # Every hour at minute 0
Common cron patterns
| Pattern | Schedule |
|---|---|
'0 * * * *' | Every hour |
'*/15 * * * *' | Every 15 minutes |
'0 0 * * *' | Daily at midnight |
'0 6 * * *' | Daily at 6 AM |
'0 0 * * 1' | Weekly on Monday at midnight |
'0 0 1 * *' | Monthly on the 1st at midnight |
'0 0 * * 1-5' | Weekdays at midnight |
Events
Event triggers activate Automations based on system events.
Event types
| Event type | Description |
|---|---|
FlowRunSuccess | Flow completed successfully |
FlowRunError | Flow failed |
FlowRunStart | Flow started |
ComponentRunSuccess | Component completed |
ComponentRunFailure | Component failed |
Event filters
Filter events using SQL or Python expressions.
SQL filter
events:
- types:
- FlowRunSuccess
sql_filter: json_extract_string(event, '$.data.flow') = 'my-flow-name'
Python filter
events:
- types:
- FlowRunSuccess
python_filter: |
import json
event_data = json.loads(event)
return event_data.get('data', {}).get('flow') == 'my-flow-name'
Multiple event types (no filter)
events:
- types:
- FlowRunSuccess
- FlowRunError
SQL filter functions
json_extract_string(event, '$.path.to.field'): Extract string valuesjson_extract(event, '$.path.to.field'): Extract any JSON value- Standard SQL operators:
=,!=,>,<,AND,OR,IN,LIKE
Actions
Actions define what happens when an Automation triggers.
Run Flow action
Execute a Flow:
actions:
- type: run_flow
name: run-my-flow
config:
flow: my-flow-name
Run Otto action
Execute Otto with a specific prompt:
actions:
- type: run_otto
name: analyze-failure
config:
agent_name: failure-analyzer # Optional: specific Otto agent
prompt: |
Analyze the recent flow failure and identify the root cause.
Check recent git commits and suggest fixes.
Email alert action
Send email notifications:
actions:
- type: email_alert
name: notify-on-failure
config:
emails:
- team@company.com
- alerts@company.com
include_otto_summary: true # Include Otto's explanation
Configuration options:
emails(required): List of email addressesinclude_otto_summary(optional): Include Otto's analysis of the event (default: false)agent_name(optional): Specific Otto agent to use for explanationprompt(optional): Additional prompt for Otto when generating explanation
Function action
Execute a custom Python function:
actions:
- type: function
name: custom-handler
config:
python:
entrypoint: src.automations.my_automation.handle_event
Multiple actions
Execute multiple actions sequentially:
actions:
- type: run_flow
name: run-primary-flow
config:
flow: primary-flow
- type: email_alert
name: notify-team
config:
emails:
- team@company.com
- type: run_flow
name: run-secondary-flow
config:
flow: secondary-flow
Create your Automation
- Files panel
- Configuration UI
Using the Files panel
- Navigate to the Files panel
- Right-click on the Automations folder and select New file
- Name your Automation (e.g.,
hourly-etl.yaml) - Configure your Automation using the patterns below
Using the configuration UI
- In the build panel, scroll to the Automations section and click + to create a new Automation
- The configuration interface opens in a new tab
- Add a descriptive name to your Automation
- Configure Sensors, Events, and Actions using the UI controls
- Click Save after each addition
Common patterns
Scheduled Flow execution
Run a Flow on a regular schedule:
Event-driven pipeline
Trigger downstream Flows when upstream completes:
automation:
name: cascade-pipeline
enabled: true
triggers:
events:
- types:
- FlowRunSuccess
sql_filter: json_extract_string(event, '$.data.flow') = 'extract-data'
actions:
- type: run_flow
name: run-transform
config:
flow: transform-data
Failure notification
Send email alerts with Otto analysis when a Flow fails:
Multi-Flow orchestration
Trigger multiple downstream Flows from a single upstream event:
All failures notification
Trigger on any Flow failure without specifying individual Flows:
automation:
name: all-failures-alert
enabled: true
triggers:
events:
- types:
- FlowRunError
actions:
- type: email_alert
name: notify-on-any-failure
config:
emails:
- alerts@company.com
include_otto_summary: true
Python Automations
For complex logic, define Automations programmatically using Python decorators.
Basic Python Automation
Mixed declarative and programmatic
Combine YAML triggers with Python actions:
Best practices
- Use descriptive names: Name Automations to indicate their purpose
- Be specific with filters: Use SQL filters to avoid unintended triggers
- Use
enabled: falsefor testing: Disable Automations during development - Separate concerns: Create separate Automations for success and failure scenarios
- Include Otto summaries: Use
include_otto_summary: truefor failure alerts to get AI-powered analysis
Next steps
- Explore Automation reference
- Learn about Sensors
- See Actions
- Build Otto Automations for AI-powered workflows