Overview
Workflows enable you to automate treasury operations, reducing manual work and ensuring consistent execution of your treasury strategy. This guide will show you how to set up and manage automated workflows.What are Workflows?
A workflow is an automation that executes transactions based on triggers you define. Each workflow:- Operates on a specific account
- Contains one or more triggers
- Creates transactions automatically when triggered
- Can be paused or activated as needed
Workflow Components
1. Workflows
The top-level automation container:2. Triggers
Conditions that cause a workflow to execute:Schedule
Time-based execution (cron schedule)
Balance Above
When account balance exceeds threshold
Balance Below
When account balance falls below threshold
Manual
Execute on-demand via API or UI
3. Transaction Config
What happens when the trigger fires:- Type:
deposit,withdraw, ortransfer - Amount: How much to transact
- Token:
usdc,usdt, orusds - Strategy: Which DeFi protocol to use (for deposits/withdrawals)
Creating Your First Workflow
Step 1: Create the Workflow
Step 2: Add a Trigger
Common Workflow Patterns
Pattern 1: Scheduled Deposits
Automatically deposit idle funds to earn yield:1
Create Workflow
Link to your treasury account
2
Add Schedule Trigger
Set daily/weekly execution time
3
Configure Deposit
Define amount and target strategy
4
Monitor
Review created transactions
0 9 * * *- Every day at 9 AM0 9 * * 1- Every Monday at 9 AM0 0 1 * *- First day of every month at midnight
Pattern 2: Balance-Based Sweeps
Automatically sweep excess funds to your treasury:Pattern 3: Strategic Withdrawals
Withdraw funds when yield drops or you need liquidity:Pattern 4: Manual Execution
Create workflows that you trigger manually when needed:Managing Workflows
Pause a Workflow
Temporarily stop a workflow from executing:Update a Trigger
Modify trigger conditions:Delete a Workflow
Remove a workflow and all its triggers:Transaction Approval Flow
When a workflow creates a transaction, it follows the standard approval flow:1
Trigger Fires
Workflow trigger condition is met
2
Transaction Created
Transaction created with status
pending_approval3
Team Reviews
Authorized users review the transaction
4
Approval
User approves:
POST /api/transactions/{id}/approve5
Execution
Execute on-chain:
POST /api/transactions/{id}/executeWorkflow-generated transactions still require manual approval before execution, ensuring you always have control.
Best Practices
Start Small
Start Small
Test workflows with small amounts before deploying to production with large values.
Use Descriptive Names
Use Descriptive Names
Clear names help your team understand what each workflow does at a glance.
Monitor Regularly
Monitor Regularly
Review workflow-generated transactions to ensure they’re working as expected.
Set Up Alerts
Set Up Alerts
Configure notifications for workflow-generated transactions that need approval.
Document Your Strategy
Document Your Strategy
Use the description field to explain why each workflow exists and what it accomplishes.
One Workflow Per Account
One Workflow Per Account
Keep workflows focused on a single account for clearer tracking and management.
Advanced: Complex Workflows
Multi-Trigger Workflow
A single workflow can have multiple triggers:Troubleshooting
Workflow Not Executing
Workflow Not Executing
Check:
- Workflow status is
active - Trigger status is
active - Trigger conditions are being met
- Account has sufficient balance
Transactions Stuck in Pending
Transactions Stuck in Pending
Solution:
- Review and approve pending transactions
- Check if approval permissions are correctly set
- Verify no team members are blocking approvals
Wrong Amount Being Transacted
Wrong Amount Being Transacted
Fix:
- Update trigger’s
transactionConfig - Ensure amount format is correct (string, not number)
- Check if using
excessorallkeywords correctly