Tutorials

Learn how to build powerful automations with step-by-step tutorials.

Getting Started Tutorials

Your First AI Workflow

Build a simple workflow that uses AI to process text:

  1. Create a Start Node

    • Add input data: { "text": "Hello World" }
  2. Add an Agent Node

    • Model: GPT-5
    • Prompt: "Translate this to Spanish: {{input.text}}"
    • Temperature: 0.3
  3. Connect and Execute

    • Draw connection from Start to Agent
    • Click the Run button (▶️) in the top toolbar
    • View the translation result

Data Processing Pipeline

Transform and enrich data through multiple steps:

  1. Start with Raw Data

    {
      "users": [
        { "name": "Alice", "age": 30 },
        { "name": "Bob", "age": 25 }
      ]
    }
    
  2. Loop Through Users

    • Add Loop Node (For Each)
    • Array Path: users
  3. Enrich Each User

    • Inside loop: Add Agent Node
    • Prompt: "Generate a bio for {{item.name}} who is {{item.age}} years old"
  4. Collect Results

    • Connect loop output to final Action node
    • Transform to desired format

Your First CodeBook

Build a small notebook one cell at a time — a text cell with an equation, a sheet with formulas, a chart, Python that reads the table, a picture made with matplotlib, and an agent that explains the result. The full walkthrough is Your First CodeBook.

Values in Every Language

The same small table, summed in JavaScript, TypeScript, Lua, Ruby, Go, Rust, C, C++, Zig and Shell — how each reads the step above and what it passes on. See Values in Every Language.

Python Graphics

A Python file can draw on a preview beside the code, in 2D and 3D. Seven tutorials, each a program you can run: your first drawing, a bouncing ball, a simple game, a spinning 3D cube, lighting a scene, a solar system and a live chart. Start at Pyctures.

JavaScript Graphics

A plain JavaScript file can draw on a preview beside the code too, with no HTML to write. The same seven tutorials in JavaScript: your first drawing, a bouncing ball, a simple game, a spinning 3D cube, lighting a scene, a solar system and a live chart. Start at pictures.js.

API Integration Tutorials

REST API Automation

Connect to external APIs and process responses:

1. Fetch Data from API

Start → Action (HTTP Request) → Process Data

Action Configuration:

{
  "method": "GET",
  "url": "https://api.example.com/data",
  "headers": {
    "Authorization": "Bearer {{env.API_TOKEN}}"
  }
}

2. Process API Response

Add Agent node to analyze data:

Prompt:

Analyze this API response and extract key insights:
{{previousNode.output}}

Format as bullet points.

3. Send Results

Use Action node to send processed data:

{
  "method": "POST",
  "url": "https://webhook.site/unique-id",
  "body": {
    "insights": "{{previousNode.output}}",
    "timestamp": "{{now}}"
  }
}

Webhook Integration

Receive and process webhook events:

  1. Create Trigger Node

    • Type: Webhook
    • Generate unique URL
  2. Validate Webhook Data

    • Add Condition Node
    • Check: input.event === "user.created"
  3. Process Valid Events

    • True branch: Process new user
    • False branch: Log and skip
  4. Send Confirmation

    • Action node with HTTP response

Email Automation

Automated Email Responses

Build an intelligent email responder:

Workflow Structure

Email Trigger → Analyze Content → Generate Response → Send Reply

1. Set Up Email Trigger

{
  "trigger": "email",
  "filter": {
    "to": "support@example.com",
    "subject": "contains('help')"
  }
}

2. Analyze with AI

Agent Node Configuration:

  • Model: GPT-5
  • System: "You are a helpful customer support agent"
  • Prompt:
Analyze this email and determine:
1. Customer sentiment
2. Main issue
3. Urgency level

Email: {{input.body}}

3. Generate Response

Second Agent Node:

Based on this analysis: {{previousNode.output}}

Write a professional response to: {{input.body}}

Be helpful, empathetic, and provide clear next steps.

4. Send Reply

Email Action Node:

{
  "to": "{{input.from}}",
  "subject": "Re: {{input.subject}}",
  "body": "{{previousNode.output}}",
  "cc": "support-team@example.com"
}

Data Transformation

CSV to JSON Processing

Convert and enrich CSV data:

  1. Read CSV File
// Action Node: Parse CSV
const rows = parseCSV(input.csvData);
return { data: rows };
  1. Transform Each Row
// Loop + Action Node
return {
  id: generateId(),
  ...item,
  processed: true,
  timestamp: new Date().toISOString()
};
  1. Aggregate Results
// Join Node
return {
  total: input.length,
  processed: input,
  summary: generateSummary(input)
};

AI-Powered Workflows

Content Generation Pipeline

Create a complete content generation system:

1. Research Phase

Start → Agent (Research) → Extract Key Points

Research Prompt:

Research the topic: {{input.topic}}
Provide 5 key facts with sources.

2. Content Creation

Key Points → Fork → [Blog Post, Social Media, Email]

Blog Post Branch:

Write a 500-word blog post about {{input.topic}}
using these key points: {{research.keyPoints}}

Tone: Professional but engaging
Include: Introduction, 3 main sections, conclusion

Social Media Branch:

Create 3 social media posts about {{input.topic}}:
1. Twitter thread (3-5 tweets)
2. LinkedIn post (150 words)
3. Instagram caption (100 words)

Key points: {{research.keyPoints}}

3. Review and Publish

Join Results → Review Agent → Publish Actions

Sentiment Analysis Pipeline

Analyze customer feedback at scale:

  1. Collect Feedback

    • Source: API, Database, or File
    • Format: Array of feedback objects
  2. Parallel Analysis

Feedback → Fork → [Sentiment, Topics, Urgency]
  1. Sentiment Branch
Analyze sentiment (positive/negative/neutral):
{{input.feedback}}

Return: { sentiment: "...", score: 0-1 }
  1. Topic Extraction
Extract main topics and categories from:
{{input.feedback}}

Return: { topics: [...], categories: [...] }
  1. Urgency Detection
Determine urgency level (1-5) for:
{{input.feedback}}

Consider: Keywords, sentiment, explicit requests
  1. Aggregate and Act
// Join Node
const results = {
  feedback: input.original,
  sentiment: input.sentiment,
  topics: input.topics,
  urgency: input.urgency,
  action: determineAction(input)
};

// Route to appropriate team
if (results.urgency >= 4) {
  notifyUrgent(results);
}

Control Flow

Capture, Route, and Pace

Combine a Set Variable, a Switch, and a Wait into one small flow. This handles an incoming order: it remembers a spending threshold from the input, routes on whether the order clears it, and spaces out a downstream action.

Workflow Structure

Start → Set Variable → Switch ─ [over]  → Notify → Wait → Log
                              ─ [under] → Log

1. Provide Input

Start node input:

{
  "orderId": 5012,
  "amount": 1800,
  "limit": 1000
}

2. Capture the Threshold

Add a Set Variable node:

  • Variable name: threshold
  • Value: input.limit

The original input still flows on, and threshold (1000) is now remembered for the rest of the flow.

3. Route on the Threshold

Add a Switch node with two cases:

// Case "over":  the order clears the threshold
input.amount > vars['threshold']

// Case "under": everything else
true

Because the first match wins, an order of 1800 follows the over output; anything at or below 1000 falls to under.

4. Pace the Downstream Action

On the over path, add a Notify step, then a Wait node before logging so repeated runs don't hammer the next service:

  • Wait mode: Duration
  • Amount: 2 seconds
Switch [over] → Notify → Wait (2 seconds) → Log

5. Reference the Variable Anywhere

Both branches can still reach the captured value without rewiring — for example, in a log message:

Order {{input.orderId}} of {{input.amount}} vs limit {{vars['threshold']}}

This pattern scales: capture once with Set Variable, branch cleanly with Switch, and smooth out timing with Wait.

Advanced Patterns

Error Handling Pattern

Build robust workflows with error handling:

Try Block → [Success Path]
         → [Error Handler] → Log → Notify → Recover

Retry Pattern

Implement automatic retries:

// Loop Node with retry logic
{
  "maxRetries": 3,
  "backoff": "exponential",
  "condition": "output.success === false"
}

Circuit Breaker Pattern

Prevent cascade failures:

// Condition Node
if (failureCount > threshold) {
  return { circuitOpen: true, fallback: true };
}

Best Practices

1. Start Simple

  • Test each node individually
  • Build incrementally
  • Use sample data

2. Handle Edge Cases

  • Check for null/undefined
  • Validate data formats
  • Plan for API failures

3. Optimize Performance

  • Use parallel processing
  • Cache when possible
  • Minimize API calls

4. Document Your Workflows

  • Name nodes descriptively
  • Add comments in complex logic
  • Document expected inputs/outputs

Next Steps