Search anything...
K
Back to Docs
  • Introduction
  • Quick Start
  • Account Setup
  • AI Studio
  • Chat
  • Agents
  • Voice
  • MCP Servers
  • Workflows
  • Authentication
  • Studio API
  • Chat API
  • Agents API
  • Voice API
  • Workflows API
  • Webhooks
  • Error Codes
  • Creating Custom Agents
  • MCP Integration
  • Building Workflows
  • Prompt Engineering
  • Team Management
  • Billing & Plans
  • Usage Monitoring
  • Single-Tenant Cloud
  • Private VPC Deployment
  • SSO Configuration
  • Security Policies
  • Compliance
  • Troubleshooting
  • API Versioning
DocsFeaturesWorkflows

Workflows

Automate complex AI tasks with visual workflow builder

Workflows allow you to automate complex AI tasks by chaining multiple operations together. Build visual pipelines, execute via API, and integrate with external systems through webhooks.

Overview

Workflows provide:

  • Visual Builder - Drag-and-drop workflow creation
  • API Execution - Trigger workflows programmatically
  • Webhooks - Integrate with external systems
  • Run History - Track and monitor executions
  • Reusable Components - Build modular workflows

Workflow Concepts

What is a Workflow?

A workflow is a sequence of connected steps that process data:

[Trigger] → [Step 1] → [Step 2] → [Step 3] → [Output]

Components

ComponentDescription
TriggerHow the workflow starts (API, webhook, schedule)
StepsIndividual operations in the workflow
ConnectionsData flow between steps
VariablesDynamic values passed through the workflow
OutputFinal result of the workflow

Step Types

TypeDescriptionExample
AI ChatSend message to AI modelGenerate content
Image GenerationCreate imagesGenerate product images
TransformModify dataFormat text, parse JSON
HTTP RequestCall external APIsFetch data, send webhooks
ConditionBranch logicIf/else decisions
LoopIterate over itemsProcess list of items

Creating Workflows

Step 1: Start New Workflow

  1. Navigate to Workflows in the sidebar
  2. Click New Workflow
  3. Enter workflow details:
    • Name: Descriptive name
    • Description: What it does

Step 2: Add Trigger

Choose how the workflow starts:

API Trigger

  • Triggered via REST API call
  • Accepts input parameters
  • Returns output data

Webhook Trigger

  • Triggered by external webhooks
  • Parses incoming payload
  • Responds with result

Manual Trigger

  • Run from the dashboard
  • Good for testing
  • Input via form

Step 3: Add Steps

Drag steps from the palette to the canvas:

  1. Click and drag a step type
  2. Drop onto the canvas
  3. Connect to previous step
  4. Configure step settings

Step 4: Configure Steps

Each step has specific configuration:

AI Chat Step

Model: gemini-2.0-flash
System Prompt: "You are a helpful assistant"
Message: "{{input.userMessage}}"
Temperature: 0.7

Image Generation Step

Model: flux-pro-1.1
Prompt: "{{previousStep.imageDescription}}"
Aspect Ratio: 16:9
Quality: high

HTTP Request Step

Method: POST
URL: https://api.example.com/data
Headers:
  Authorization: Bearer {{secrets.API_KEY}}
Body: {{previousStep.output}}

Step 5: Connect Steps

Draw connections to define data flow:

  1. Click output port of source step
  2. Drag to input port of target step
  3. Connection is created

Step 6: Test & Save

  1. Click Test to run with sample data
  2. Review execution results
  3. Debug any issues
  4. Click Save when ready

Workflow Examples

Content Generation Pipeline

Generate blog content automatically:

[API Trigger]
    ↓
[AI Chat: Generate Outline]
    ↓
[AI Chat: Write Introduction]
    ↓
[AI Chat: Write Body Sections]
    ↓
[AI Chat: Write Conclusion]
    ↓
[Transform: Combine Sections]
    ↓
[Output: Complete Article]

Configuration:

Step 1 - Generate Outline:
  model: gemini-1.5-pro
  prompt: "Create an outline for a blog post about {{input.topic}}"

Step 2 - Write Introduction:
  model: gemini-2.0-flash
  prompt: "Write an engaging introduction based on this outline: {{step1.output}}"

# ... additional steps

Image Batch Generation

Generate multiple images from descriptions:

[API Trigger: List of Descriptions]
    ↓
[Loop: For Each Description]
    ↓
  [Image Generation: Create Image]
    ↓
  [HTTP Request: Upload to Storage]
    ↓
[Output: List of Image URLs]

Customer Support Automation

Automated ticket response:

[Webhook Trigger: New Support Ticket]
    ↓
[AI Chat: Categorize Ticket]
    ↓
[Condition: Is Common Issue?]
    ↓ Yes                    ↓ No
[AI Chat: Generate    [HTTP Request: Create
 Auto Response]        Manual Ticket]
    ↓                        ↓
[HTTP Request:         [Output: Ticket ID]
 Send Response]

Social Media Content

Create multi-platform content:

[API Trigger: Content Brief]
    ↓
[AI Chat: Generate Core Message]
    ↓
[Parallel]
  ├→ [AI Chat: Twitter Version]
  ├→ [AI Chat: LinkedIn Version]
  └→ [AI Chat: Instagram Caption]
    ↓
[Transform: Combine Outputs]
    ↓
[Output: All Versions]

Variables & Data Flow

Input Variables

Define workflow inputs:

inputs:
  - name: topic
    type: string
    required: true
  - name: tone
    type: string
    default: "professional"
  - name: wordCount
    type: number
    default: 500

Accessing Data

Reference data using template syntax:

SyntaxDescription
{{input.name}}Access input variable
{{step1.output}}Access step output
{{secrets.KEY}}Access secret value
{{env.VARIABLE}}Access environment var

Transform Expressions

Modify data with expressions:

// Extract field
{{previousStep.output.data.items}}

// String manipulation
{{input.name.toUpperCase()}}

// Conditional
{{input.premium ? "VIP" : "Standard"}}

// Array operations
{{items.map(i => i.name).join(", ")}}

API Execution

Execute Workflow via API

curl -X POST https://www.girardai.com/api/v1/workflows/{id}/execute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "topic": "AI in Healthcare",
      "tone": "professional"
    }
  }'

Response

{
  "runId": "run_abc123",
  "status": "running",
  "message": "Workflow execution started"
}

Check Run Status

curl https://www.girardai.com/api/v1/runs/{runId} \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "runId": "run_abc123",
  "status": "completed",
  "duration": 12500,
  "output": {
    "article": "# AI in Healthcare\n\n..."
  }
}

Webhook Integration

Setting Up Webhooks

  1. In workflow settings, enable Webhook Trigger
  2. Copy the webhook URL
  3. Configure external service to call this URL

Webhook URL Format

https://www.girardai.com/api/v1/webhooks/{workflowId}

Webhook Payload

Send JSON data to trigger:

{
  "event": "new_order",
  "data": {
    "orderId": "12345",
    "customer": "John Doe",
    "items": ["Product A", "Product B"]
  }
}

Webhook Security

Verify webhook authenticity:

// Webhook signature header
X-Girard-Signature: sha256=abc123...

// Verify in your handler
const crypto = require('crypto');
const expectedSig = crypto
  .createHmac('sha256', webhookSecret)
  .update(payload)
  .digest('hex');

Run History

Viewing Runs

  1. Open a workflow
  2. Click Runs tab
  3. See list of executions

Run Details

FieldDescription
Run IDUnique identifier
Statusrunning, completed, failed
StartedStart timestamp
DurationExecution time
TriggerHow it was started

Run States

StatusDescription
QueuedWaiting to start
RunningCurrently executing
CompletedFinished successfully
FailedError occurred
CancelledManually stopped

Debugging Runs

View detailed execution:

  1. Click on a run
  2. See step-by-step execution
  3. View inputs/outputs per step
  4. Check error messages

Best Practices

Design Principles

  1. Keep It Simple - Start with minimal steps
  2. Handle Errors - Add error handling
  3. Use Variables - Make workflows reusable
  4. Test Thoroughly - Test edge cases
  5. Document - Add descriptions

Performance Tips

  1. Parallelize - Run independent steps together
  2. Cache Results - Avoid duplicate operations
  3. Optimize Prompts - Clear, concise AI prompts
  4. Batch Operations - Group similar tasks

Error Handling

Add error handling steps:

On Error:
  - Log error details
  - Send notification
  - Retry with backoff
  - Graceful fallback

Troubleshooting

Workflow Won't Run

  1. Check workflow is saved
  2. Verify trigger configuration
  3. Ensure API key has permissions
  4. Check input validation

Step Failing

  1. Review step configuration
  2. Check input data format
  3. Verify API connections
  4. Review error messages

Slow Execution

  1. Identify bottleneck steps
  2. Parallelize where possible
  3. Optimize API calls
  4. Check rate limits

Data Not Passing

  1. Verify connection exists
  2. Check variable syntax
  3. Review data types
  4. Test with sample data

Previous: MCP Servers | Next: API Authentication

Previous
MCP Servers
Next
Authentication