Flow Technical Notes
Configuration, limits, best practices, and implementation details
This page provides technical details, configuration options, limits, and best practices for working with flows.
Cron Expression Syntax
Time-based flows use cron expressions to define schedules. Cron expressions consist of 5 fields separated by spaces.
Cron Format
Special Characters
*Any value. Example:
* * * * *runs every minute.,Value list separator. Example:
0 9,17 * * *runs at 9 AM and 5 PM.-Range of values. Example:
0 9-17 * * *runs every hour from 9 AM to 5 PM./Step values. Example:
*/15 * * * *runs every 15 minutes.
Common Patterns
Validation
Cron expressions are validated on flow creation. Invalid expressions return a validation error:
Common validation errors:
- Incorrect number of fields (must be exactly 5)
- Values out of range (e.g., hour = 25)
- Invalid step values (e.g., */0)
- Malformed expressions
Timezone Handling
All cron schedules execute in UTC timezone. To schedule for a specific local timezone, calculate the UTC offset:
Tip: Use tools like crontab.guru to validate and understand cron expressions.
Event Condition Syntax
Event-based flows use condition trees to filter events. Conditions support nested AND/OR logic with field-level comparisons.
Condition Structure
Operators
Logical Operators
ANDAll nested conditions must be true.
ORAt least one nested condition must be true.
Comparison Operators
equalsField value exactly matches the specified value.
containsField value contains the specified substring (case-insensitive).
startsWithField value starts with the specified prefix.
endsWithField value ends with the specified suffix.
greaterThanField value is greater than the specified number.
lessThanField value is less than the specified number.
existsField is present in the event (value should be true/false).
regexField value matches the specified regular expression.
Nested Conditions
Conditions can be nested to create complex logic:
This matches: (text contains "urgent" OR text contains "asap") AND (not a group chat)
Available Fields by Event Type
Different event types provide different fields for filtering:
telegram.message:
text- Message text contentsender- Username of message senderchatId- Telegram chat IDisGroupChat- Boolean indicating group chattimestamp- Message timestamp
gmail.email_received:
subject- Email subject linefrom- Sender email addressto- Recipient email addressesbody- Email body contenthasAttachment- Boolean indicating attachmentstimestamp- Email received timestamp
calendar.event_created:
summary- Event titledescription- Event descriptionlocation- Event locationattendees- Array of attendee emailsstartTime- Event start timestampendTime- Event end timestamp
voice.call_ended:
duration- Call duration in secondsparticipants- Array of participant IDssummary- AI-generated call summarytranscript- Call transcripttimestamp- Call end timestamp
Execution Modes
LLM Mode
Characteristics:
- Executes natural language prompts via AI agent
- Automatically selects and uses appropriate tools
- Handles multi-step workflows intelligently
- Adapts to context and edge cases
- Higher latency (~2-10 seconds)
- Variable cost based on prompt complexity
Best For:
- Complex decision-making workflows
- Natural language processing tasks
- Dynamic tool selection requirements
- Rapid prototyping and iteration
Configuration:
All flows now execute scripts directly for deterministic, predictable behavior with lower latency and fixed costs.
Limits and Quotas
Flow Creation Limits
- Maximum flows per user: 1,000
- Maximum flows created per day: 100
- Maximum flow title length: 200 characters
- Maximum flow description length: 1,000 characters
- Maximum prompt length: 10,000 characters
Execution Limits
- Maximum executions per flow per day: 10,000
- Maximum concurrent executions per flow: 10
- Maximum execution duration: 300 seconds (5 minutes)
- Maximum memory per execution: 3,008 MB
Cron Schedule Limits
- Minimum interval between executions: 1 minute
- Maximum schedules per flow: 1
- Timezone: UTC only
Event Condition Limits
- Maximum condition tree depth: 5 levels
- Maximum conditions per tree: 50
- Maximum field name length: 100 characters
- Maximum condition value length: 1,000 characters
Recommended Limits
For optimal performance and cost control, we recommend:
- Cron frequency: No more frequent than every 5 minutes for most use cases
- Event conditions: Keep condition trees simple (≤3 levels deep)
- Execution duration: Target ≤30 seconds for LLM mode, ≤10 seconds for direct mode
- Tool recommendations: Specify 2-5 tools maximum
Performance Optimization
Cron Schedule Optimization
Distribute load across time:
Use appropriate intervals:
Event Condition Optimization
Use specific conditions early:
This is more efficient than:
Avoid expensive operations:
- Minimize regex conditions (use simple string operations when possible)
- Place specific filters before general filters
- Use
equalsinstead ofcontainswhen exact match is needed
Execution Optimization
Keep prompts focused:
vs.
Use direct mode for deterministic tasks:
Error Handling
Execution Errors
Flows automatically retry failed executions with exponential backoff:
- 1st retry: After 1 minute
- 2nd retry: After 5 minutes
- 3rd retry: After 15 minutes
- Final retry: After 1 hour
After 4 failed attempts, the flow is paused and you receive a notification.
Validation Errors
Validation errors occur during flow creation or update:
Common causes:
- Invalid cron expression syntax
- Missing required fields
- Invalid event type
- Malformed condition tree
- Field values exceeding limits
Runtime Errors
Runtime errors occur during flow execution:
Common causes:
- Execution timeout (exceeded 300 seconds)
- Memory limit exceeded
- Cost limit exceeded
- Tool/resource unavailable
- Invalid tool parameters
Security and Privacy
Access Control
Flows execute with the creating user's permissions:
- Access user's Telegram messages
- Access user's Gmail
- Access user's calendar events
- Use user's API keys and resources
Flows cannot:
- Access other users' data
- Execute with elevated privileges
- Bypass resource access controls
- Modify other users' flows
Data Retention
Flow execution data is retained:
- Execution history: Last 100 executions
- Execution logs: 30 days
- Execution results: 90 days
API Key Security
Flow API operations require authentication via API key:
Best practices:
- Rotate API keys regularly
- Use environment variables for API keys
- Never commit API keys to version control
- Revoke compromised keys immediately
Cost Management
Understanding Costs
Flow execution costs include:
- Scheduling overhead: Minimal (~$0.0001 per scheduled check)
- LLM execution: $0.01 - $0.10 per execution (varies by complexity)
- Direct execution: $0.001 - $0.01 per execution (varies by script)
- Tool usage: Variable based on external API costs
Estimating Costs
Example 1: Daily report flow
Example 2: High-frequency monitoring
Cost Optimization
Use appropriate execution modes:
- LLM mode: Complex, variable tasks
- Direct mode: Simple, deterministic tasks
Optimize schedules:
- Reduce frequency when possible
- Combine multiple checks into single execution
- Use event-based triggers instead of polling
Set budget limits:
Monitoring and Observability
Execution History
View detailed execution history:
Response includes:
Metrics and Analytics
Track flow performance:
- Execution count: Total number of executions
- Success rate: Percentage of successful executions
- Average duration: Mean execution time
- Average cost: Mean cost per execution
- Last execution: Most recent execution timestamp
Debugging Failed Executions
For failed executions, review:
- Error message: Primary error description
- Execution logs: Step-by-step execution trace
- Stack trace: Detailed error context (for script executions)
- Input data: Event or trigger data that caused execution
Best Practices
Design Principles
Single Responsibility:
- Each flow should do one thing well
- Break complex workflows into multiple flows
- Chain flows via events or schedules when needed
Idempotency:
- Design flows to be safely re-executable
- Handle duplicate executions gracefully
- Use unique identifiers to prevent duplicates
Fault Tolerance:
- Expect and handle errors gracefully
- Use try-catch patterns in prompts
- Implement fallback behaviors
Testing
Test in draft mode:
- Create flow
- Test with manual trigger
- Verify results
- Activate schedule/events
Gradual rollout:
- Start with infrequent schedules
- Monitor initial executions
- Increase frequency after verification
Error notification:
- Set up alerts for failed executions
- Review error logs regularly
- Fix issues proactively
Documentation
Document your flows:
Version control:
- Track flow configuration changes
- Document significant updates
- Maintain changelog for complex flows
Troubleshooting
Flow Not Executing
Check:
- Flow status is "active" not "paused"
- Cron expression is valid and in UTC
- Daily execution limit not exceeded
- User has required tool permissions
Execution Failures
Check:
- Execution logs for error messages
- Tool availability and credentials
- Resource access permissions
- Execution duration and memory limits
Unexpected Behavior
Check:
- Event condition logic (AND vs OR)
- Field names match event schema
- Timezone calculations for cron
- Prompt clarity and tool recommendations