What You’ll Build
A simple automation that:- Takes an input (e.g., a wallet address)
- Runs a SQL query to analyze the wallet
- Uses an agent to summarize the results
- Sends the summary via email
Prerequisites
- A Flipspace account with access to Automations
- Basic familiarity with SQL (optional—you can use existing queries)
Step 1: Create a New Automation
1
Open Automations
Navigate to Automations in Flipspace.
2
Click Create
Click the Create Automation button to open the workflow builder.
3
Name your automation
Give your automation a descriptive name, like “Daily Wallet Summary”.
Step 2: Add an Input Block
The Input block defines what data your automation needs to run.1
Drag Input block
From the sidebar, drag the Input block onto the canvas.
2
Configure the input
Set up the input parameters: - Name:
wallet_address - Type: Text - Description:
“The wallet address to analyze”3
Connect to next block
Drag from the output handle to connect to the next block.
Step 3: Add a Query Block
The Query block runs SQL against Flipside’s data warehouse.1
Add a Query block
Drag a query from the Queries section in the sidebar, or click Create new query.
2
Write or select your query
Use a query that references your input variable: ```sql SELECT date_trunc(‘day’,
block_timestamp) as day, count(*) as tx_count, sum(amount_usd) as volume_usd FROM
ethereum.core.ez_token_transfers WHERE from_address = '' AND block_timestamp
= current_date - 30 GROUP BY 1 ORDER BY 1 ```
3
Connect input to query
Connect the Input block’s output to the Query block’s input.
Step 4: Add an Agent Block
The Agent block uses AI to process and summarize results.1
Add an Agent block
Drag an agent from the Agents section in the sidebar.
2
Configure the prompt
Tell the agent what to do with the query results:
text Summarize this wallet's activity over the past 30 days. Highlight any notable patterns or large transactions. Keep the summary under 200 words. 3
Connect query to agent
Connect the Query block’s output to the Agent block’s input.
Step 5: Add an Email Block
The Email block sends results to specified recipients.1
Add an Email block
Drag the Email block from the Core section.
2
Configure recipients
Add email addresses for recipients.
3
Set subject and body
- Subject: “Daily Wallet Summary for ” - Body: Reference the agent’s
output using
{{ agent_output }}
4
Connect agent to email
Connect the Agent block’s output to the Email block.
Step 6: Test Your Automation
1
Click Test
Use the Test button to run your automation with sample data.
2
Provide test inputs
Enter a wallet address to test with.
3
Review results
Check each block’s output to ensure it’s working correctly.
Step 7: Schedule or Deploy
Once tested, you can:- Run manually: Trigger the automation on-demand
- Schedule: Set up recurring runs (daily, weekly, etc.)
- Trigger via API: Call the automation programmatically
Complete Workflow
Your finished automation should look like this:FAQ & Troubleshooting
My query isn't returning results
My query isn't returning results
Check your query:
- Verify the SQL syntax is correct
- Test the query in the SQL Editor first
- Ensure input variables are properly referenced with
{{variable}} - Check date ranges aren’t filtering out all data
The agent output isn't what I expected
The agent output isn't what I expected
Improve your prompt: - Be more specific about the desired output format - Provide examples of
what you want - Break complex tasks into multiple agent blocks
Email isn't being delivered
Email isn't being delivered
Verify email settings: - Check recipient email addresses are correct - Look in spam/junk
folders - Ensure your account has email delivery enabled
Automation fails intermittently
Automation fails intermittently
Common causes: - Query timeout: Optimize your SQL or reduce data range - Rate limits: Add
delays between blocks if needed - Missing data: Add conditional blocks to handle empty results
How do I debug a failed run?
How do I debug a failed run?
Debugging steps:
- Open the automation’s run history
- Click on the failed run
- Inspect each block’s input and output
- Check error messages for specific issues
Alternative: Create via CLI
You can also create automations using the Flipside CLI for programmatic control and version management:CLI: Automations
Full CLI documentation for creating and managing automations