Skip to main content
Composite functions execute a sequence of different function types, passing data between them. They’re ideal for complex workflows that require multiple steps with different capabilities.

Configuration

array
required
List of functions to execute in order. Each can be any function type.
string
Variable name to store this step’s result for use in subsequent steps

Data Flow

Data flows between sequence steps using response_variable:
1

Step 1 executes

First function runs and produces a result
2

Result stored

Result is stored in the variable name specified by response_variable
3

Step 2 accesses data

Subsequent steps can use the variable in templates
4

Final result

The last step’s output becomes the function’s final result

Use Cases

Data Processing

Fetch raw data and format it for presentation

Multi-step Workflows

Execute complex sequences requiring different function types

Service + Template

Call services and format their responses

Conditional Logic

Use templates to process results conditionally

Best Practices

Use descriptive names for response_variable:
Each composite function should accomplish one logical task. If you need many steps, consider breaking into multiple functions.✅ Good: 2-4 steps for a single purpose❌ Bad: 10+ steps doing unrelated things
Add error handling in templates:
Test each step individually before combining:
  1. Create individual functions for each step
  2. Verify each works correctly
  3. Combine into composite function
  4. Test the complete sequence

Common Patterns

Pattern 1: API + Format

Pattern 2: Service + Extract

Pattern 3: Multi-source Aggregation

Pattern 4: Scrape + Process

Debugging

Enable detailed logging:
Logs will show:
  • Each step’s input parameters
  • Each step’s output result
  • Variable assignments
  • Template rendering

Examples

Search and Play Music

Search for music, then play the first result:
Music Search

Get History with Formatting

Combine native get_history with template formatting:

Fetch and Process External Data

Get data from API and format it:

Next Steps

Native Functions

Built-in functions

Template Functions

Data formatting

Script Functions

Service sequences