Automations are DAG-based pipelines for scheduled or triggered data processing. They can execute
SQL, transform data with AI, and send notifications.
The automations command is aliased as workflows - both work identically.
What Automations Can Do
- Execute SQL queries against Flipside’s data warehouse
- Transform data with AI/LLM steps
- Send email notifications
- Reference uploaded CSV files
- Accept user inputs via JSON Schema
- Run on a schedule or be triggered manually
Creating Automations
Initialize a new automation:
flipside automations init my_automation
This creates a YAML file defining the DAG:
name: my_automation
description: Daily DeFi volume report
inputs:
type: object
properties:
chain:
type: string
default: ethereum
steps:
- id: query_volumes
type: sql
sql: |
SELECT platform, SUM(amount_usd) as volume
FROM {{inputs.chain}}.defi.ez_dex_swaps
WHERE block_timestamp >= CURRENT_DATE - 1
GROUP BY 1
ORDER BY 2 DESC
- id: notify
type: email
depends_on: [query_volumes]
to: [email protected]
subject: Daily DeFi Report
Deploying Automations
Push your automation to deploy:
flipside automations push my_automation.yaml
Running Automations
# Run with default inputs
flipside automations run <automation-id>
# Run with custom inputs
flipside automations run <automation-id> -i '{"chain": "arbitrum"}'
Automation Commands
| Command | Description |
|---|
flipside automations list | List all automations |
flipside automations get <id> | Get automation details |
flipside automations init <name> | Create new automation template |
flipside automations push <file.yaml> | Deploy automation |
flipside automations pull <id> | Download automation as YAML |
flipside automations run <id> | Trigger a run |
flipside automations runs <id> | List runs for an automation |
flipside automations delete <id> | Delete an automation |
Step Types
| Type | Description |
|---|
sql | Execute a SQL query |
llm | Process data with an AI model |
email | Send an email notification |
Define inputs with JSON Schema:
inputs:
type: object
properties:
chain:
type: string
enum: [ethereum, arbitrum, base]
default: ethereum
days:
type: integer
default: 7
Reference inputs in SQL with {{inputs.property}}:
steps:
- id: query
type: sql
sql: |
SELECT * FROM {{inputs.chain}}.core.fact_blocks
WHERE block_timestamp >= CURRENT_DATE - {{inputs.days}}
Step Dependencies
Use depends_on to control execution order:
steps:
- id: step_a
type: sql
sql: ...
- id: step_b
type: sql
depends_on: [step_a]
sql: ...
- id: step_c
type: email
depends_on: [step_a, step_b]
...
Monitoring Runs
# List runs for an automation
flipside automations runs <automation-id>
# Chat about a specific run
flipside chat --run <run-id>