AI Agent Management

Workflows & Automation

Build powerful automation workflows with triggers, actions, and conditional logic to automate tasks and create intelligent interactions beyond simple Q&A.

Overview

Workflows allow you to automate complex tasks and create powerful interactions beyond simple Q&A responses. With Docimal's visual workflow builder, you can connect triggers, actions, and conditions to build intelligent automation that responds to user inputs, external events, or scheduled tasks.

Visual Builder

Drag-and-drop interface to design complex workflows with triggers, actions, and conditional logic

Real-Time Execution

Workflows execute instantly in response to triggers with full error handling and retry logic

Custom Actions

Create custom actions using JavaScript/TypeScript, call external APIs, or connect to your systems

Conditional Logic

Add branching paths, if/then conditions, loops, and data transformations to your workflows

[Placeholder: Workflow Builder Overview Interface]

Workflows are perfect for automating tasks like sending notifications, collecting lead information, updating CRM records, scheduling appointments, triggering webhooks, and more.

Visual Workflow Builder

The workflow builder provides a canvas-based interface where you can create workflows by connecting nodes. Each node represents a step in your workflow—triggers, actions, conditions, or data operations.

Creating a Workflow

1

Navigate to the Workflows tab in your agent dashboard

2

Click "Create Workflow" and give it a descriptive name

3

Start by adding a Trigger node—this is what starts your workflow

4

Add Action nodes to perform tasks when the workflow runs

5

Connect nodes by dragging from output ports to input ports

6

Configure each node by clicking on it and filling in the settings

7

Test your workflow using the "Test Run" button

8

Activate the workflow to start processing real events

[Placeholder: Workflow Canvas with Connected Nodes]

Node Types

  • Trigger Nodes: Start the workflow based on events (user messages, webhooks, schedules, etc.)
  • Action Nodes: Perform operations like sending emails, API calls, database updates, or custom code
  • Condition Nodes: Add if/then logic to branch your workflow based on data or user input
  • Data Nodes: Transform, filter, or manipulate data flowing through your workflow
  • Delay Nodes: Add time delays or wait for specific conditions before continuing
Workflows can be as simple as a single trigger and action, or as complex as multi-step processes with branching logic, loops, and data transformations. Start simple and add complexity as needed.

Triggers

Triggers define when and how your workflow starts. Every workflow must have at least one trigger. You can configure multiple triggers for a single workflow if needed.

User Message Trigger

Starts when a user sends a message matching specific keywords, phrases, or intents

  • • Keyword matching (exact or fuzzy)
  • • Intent detection using AI
  • • Regex pattern matching
  • • Multi-language support

Schedule Trigger

Runs workflows at specific times or on recurring schedules

  • • Daily, weekly, monthly schedules
  • • Cron expression support
  • • Timezone configuration
  • • One-time scheduled runs

Webhook Trigger

Starts when an external system sends data to your unique webhook URL

  • • Unique webhook URL per workflow
  • • Support for JSON and form data
  • • Authentication options
  • • Request validation and filtering

Event Trigger

Responds to platform events like new conversations, agent updates, or user actions

  • • Conversation started/ended
  • • Negative feedback received
  • • Knowledge base updated
  • • User inactivity detected

[Placeholder: Trigger Configuration Panel]

Use User Message Triggers for interactive workflows that respond to specific questions. Use Schedule Triggers for recurring tasks like daily reports or weekly summaries.

Actions

Actions are the operations your workflow performs. Docimal provides a library of pre-built actions for common tasks, and you can create custom actions for specialized needs.

Built-in Actions

Send Email

Send transactional emails to users, team members, or external recipients. Supports HTML templates, dynamic variables, and attachments.

Use cases: Send confirmation emails, notifications, reports, password resets, appointment reminders

HTTP Request

Make API calls to external services. Supports GET, POST, PUT, DELETE methods with full header and authentication control.

Use cases: Update CRM records, fetch real-time data, trigger third-party services, sync with external systems

Database Operations

Create, read, update, or delete records in your database. Supports SQL queries and NoSQL operations.

Use cases: Store conversation data, update user profiles, save lead information, track analytics

Send Message

Send a message to the user in the chat interface. Supports text, markdown formatting, buttons, and rich media.

Use cases: Provide follow-up information, ask clarifying questions, show confirmation messages, offer suggestions

[Placeholder: Action Node Configuration with Available Actions]

Custom Actions

For specialized tasks, you can create custom actions using JavaScript or TypeScript. Custom actions have access to the workflow context, user data, and conversation history.

javascript
// Example: Custom Action to Calculate Shipping Cost
export async function calculateShipping(context) {
  const { weight, destination } = context.input;

  // Custom business logic
  const baseRate = 5.99;
  const perKgRate = 2.50;
  const cost = baseRate + (weight * perKgRate);

  // Adjust for destination
  const multiplier = destination === 'international' ? 2.5 : 1;
  const total = cost * multiplier;

  return {
    shippingCost: total.toFixed(2),
    estimatedDays: destination === 'international' ? '7-14' : '2-5'
  };
}
Custom actions are isolated and run in a secure sandbox environment. They have access to approved libraries and can interact with external APIs using the HTTP client provided by Docimal.

Conditions & Logic

Add conditional logic to your workflows to create different paths based on user input, data values, or external conditions. This allows you to build dynamic, intelligent automation.

If/Then Conditions

Branch your workflow based on comparisons: equals, contains, greater than, less than, regex matches

Multiple Conditions

Combine multiple conditions with AND/OR logic for complex decision trees

Expression Builder

Use JavaScript expressions for advanced logic and data transformations

Switch Cases

Create multiple branches based on a single value, similar to switch statements in code

[Placeholder: Workflow with Branching Conditions]

Condition Examples

User Intent Detection

Route users to different workflows based on what they're asking about

If user message contains "pricing" OR "cost" → Then show pricing workflow
Else if user message contains "support" → Then connect to support team
ElseThen use general Q&A agent

Business Hours Routing

Handle requests differently based on time of day

If current time is between 9 AM - 5 PM → Then connect to live agent
ElseThen take message and send email notification

User Tier Handling

Provide different experiences based on user subscription level

If user.plan equals "enterprise" → Then enable priority support
Else if user.plan equals "pro" → Then enable standard support
ElseThen show self-service resources
Keep conditions simple and readable. If you find yourself creating very complex nested conditions, consider breaking the workflow into smaller, more focused workflows.

Variables & Data

Workflows can store and pass data between nodes using variables. This allows you to capture user input, transform data, and use values from previous actions in subsequent steps.

Variable Types

  • System Variables: Automatically available data like user ID, conversation ID, timestamp, user message, agent response
  • Custom Variables: Data you define and store during workflow execution
  • Action Outputs: Results returned by action nodes that can be used in subsequent steps
  • External Data: Data fetched from APIs, databases, or webhooks

[Placeholder: Variable Panel Showing Available Data]

Using Variables

Reference variables in your workflow using the double curly brace syntax: {{variable_name}}

text
// Example: Email template using variables
Subject: Order Confirmation #{{order.id}}

Hi {{user.firstName}},

Thank you for your order! We've received your request for:
- Product: {{order.productName}}
- Quantity: {{order.quantity}}
- Total: ${{order.total}}

Your order will be shipped to:
{{user.shippingAddress}}

Estimated delivery: {{shipping.estimatedDays}} business days

Track your order: {{order.trackingUrl}}

✓ Do

  • • Use descriptive variable names
  • • Store only necessary data
  • • Transform data close to where it's used
  • • Clear sensitive data after use

✗ Avoid

  • • Storing sensitive data unnecessarily
  • • Using unclear variable names (x, temp, data)
  • • Keeping large datasets in variables
  • • Overwriting system variables

Workflow Templates

Get started quickly with pre-built workflow templates for common use cases. Each template includes all necessary triggers, actions, and conditions—just customize with your specific data and credentials.

Lead Capture & Notification

Popular

Collect user information and notify your sales team

Automatically detects when users express interest, captures their contact information, stores it in your CRM, and sends real-time notifications to your sales team.

Trigger: User Message3 Actions1 Condition

Appointment Scheduling

Popular

Let users book appointments through chat

Checks calendar availability, collects appointment details, creates calendar events, sends confirmation emails to users and staff, and adds reminders.

Trigger: User Message5 Actions2 Conditions

Support Ticket Creation

Automatically create support tickets from conversations

Detects when the agent can't resolve an issue, creates a support ticket in your helpdesk system, provides the user with a ticket number, and routes to human support.

Trigger: Event4 Actions1 Condition

Daily Analytics Report

Send automated daily performance summaries

Runs every morning to compile conversation statistics, user satisfaction scores, common questions, and sends formatted reports to your team via email or Slack.

Trigger: Schedule3 Actions0 Conditions

Order Status Lookup

Provide real-time order tracking information

Extracts order number from user message, queries your order management system via API, retrieves current status and tracking info, and presents it in a formatted message.

Trigger: User Message2 Actions1 Condition

Feedback Collection

Gather and store user feedback systematically

Triggers on negative feedback, asks follow-up questions to understand the issue, stores responses in your database, notifies relevant team members, and schedules follow-up.

Trigger: Event4 Actions2 Conditions

[Placeholder: Workflow Templates Gallery]

All templates are fully customizable. After selecting a template, you can modify triggers, add or remove actions, adjust conditions, and integrate with your specific tools and systems.

Best Practices

Start with Simple Workflows

Begin with straightforward workflows (one trigger, one or two actions) and test thoroughly before adding complexity. This makes debugging easier and helps you understand how data flows through your workflow.

Test with Real Scenarios

Use the Test Run feature to simulate workflow execution with realistic data. Test edge cases, error conditions, and unexpected inputs to ensure your workflow handles all situations gracefully.

Add Error Handling

Always include error handling for external API calls, database operations, and custom actions. Configure what happens when an action fails—retry automatically, send notifications, or follow an alternative path.

Document Your Workflows

Give workflows clear, descriptive names and add comments to explain complex logic. Include notes about external dependencies, required credentials, and maintenance considerations for future reference.

Monitor Performance

Regularly review workflow execution logs and metrics. Track success rates, execution times, error frequency, and user satisfaction to identify optimization opportunities and potential issues.

Keep Workflows Focused

Each workflow should handle one specific task or process. If a workflow becomes too complex, consider splitting it into multiple smaller workflows that can be triggered independently or chained together.

Powered by Docimal