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
| Component | Description |
|---|---|
| Trigger | How the workflow starts (API, webhook, schedule) |
| Steps | Individual operations in the workflow |
| Connections | Data flow between steps |
| Variables | Dynamic values passed through the workflow |
| Output | Final result of the workflow |
Step Types
| Type | Description | Example |
|---|---|---|
| AI Chat | Send message to AI model | Generate content |
| Image Generation | Create images | Generate product images |
| Transform | Modify data | Format text, parse JSON |
| HTTP Request | Call external APIs | Fetch data, send webhooks |
| Condition | Branch logic | If/else decisions |
| Loop | Iterate over items | Process list of items |
Creating Workflows
Step 1: Start New Workflow
- Navigate to Workflows in the sidebar
- Click New Workflow
- 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:
- Click and drag a step type
- Drop onto the canvas
- Connect to previous step
- 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:
- Click output port of source step
- Drag to input port of target step
- Connection is created
Step 6: Test & Save
- Click Test to run with sample data
- Review execution results
- Debug any issues
- 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:
| Syntax | Description |
|---|---|
{{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
- In workflow settings, enable Webhook Trigger
- Copy the webhook URL
- 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
- Open a workflow
- Click Runs tab
- See list of executions
Run Details
| Field | Description |
|---|---|
| Run ID | Unique identifier |
| Status | running, completed, failed |
| Started | Start timestamp |
| Duration | Execution time |
| Trigger | How it was started |
Run States
| Status | Description |
|---|---|
| Queued | Waiting to start |
| Running | Currently executing |
| Completed | Finished successfully |
| Failed | Error occurred |
| Cancelled | Manually stopped |
Debugging Runs
View detailed execution:
- Click on a run
- See step-by-step execution
- View inputs/outputs per step
- Check error messages
Best Practices
Design Principles
- Keep It Simple - Start with minimal steps
- Handle Errors - Add error handling
- Use Variables - Make workflows reusable
- Test Thoroughly - Test edge cases
- Document - Add descriptions
Performance Tips
- Parallelize - Run independent steps together
- Cache Results - Avoid duplicate operations
- Optimize Prompts - Clear, concise AI prompts
- 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
- Check workflow is saved
- Verify trigger configuration
- Ensure API key has permissions
- Check input validation
Step Failing
- Review step configuration
- Check input data format
- Verify API connections
- Review error messages
Slow Execution
- Identify bottleneck steps
- Parallelize where possible
- Optimize API calls
- Check rate limits
Data Not Passing
- Verify connection exists
- Check variable syntax
- Review data types
- Test with sample data
Previous: MCP Servers | Next: API Authentication