Unclassified

Workflows

Automated Process Orchestration in IntegrateWise

Workflows are the automated processes that coordinate agents, tools, and systems to complete complex tasks efficiently and consistently. They transform repetitive manual work into intelligent, automated operations that leverage the full power of the Spine Agent Network.

Core Value: Workflows enable you to define once, execute many times, with consistent quality and full context continuity.

Overview

What are Workflows?

Workflows are:

  • Automated - Execute without manual intervention (when approved)
  • Intelligent - Use AI to make smart decisions during execution
  • Context-Aware - Maintain and leverage full context throughout
  • Governed - Follow proper permissions, approvals, and audit trails
  • Reusable - Can be executed multiple times with different inputs

Workflow Types

TypeDescriptionExample
Personal WorkflowsIndividual productivity automationDaily planning, email organization
Team WorkflowsCollaborative team processesProject approvals, team standups
Domain WorkflowsBusiness function automationLead qualification, support ticket routing
Cross-Domain WorkflowsMulti-function coordinationCustomer onboarding (Sales + Success + Support)
System WorkflowsPlatform-level operationsData synchronization, system maintenance

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    WORKFLOW ARCHITECTURE                      │
├─────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │                    WORKFLOW DEFINITION                      │ │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐    │ │
│  │  │  Trigger    │  │  Steps      │  │  Variables  │    │ │
│  │  │             │  │             │  │  & Inputs   │    │ │
│  │  └─────────────┘  └─────────────┘  └─────────────┘    │ │
│  └─────────────────────────────────────────────────────────┘ │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │                    EXECUTION ENGINE                        │ │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐    │ │
│  │  │  Orchest-  │  │  Step       │  │  Context    │    │ │
│  │  │  rator     │  │  Executor   │  │  Manager   │    │ │
│  │  └─────────────┘  └─────────────┘  └─────────────┘    │ │
│  └─────────────────────────────────────────────────────────┘ │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │                    INTEGRATION LAYER                       │ │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐    │ │
│  │  │  Agents    │  │  Tools     │  │  Systems   │    │ │
│  │  │             │  │             │  │             │    │ │
│  │  └─────────────┘  └─────────────┘  └─────────────┘    │ │
│  └─────────────────────────────────────────────────────────┘ │
│                                                                  │
└─────────────────────────────────────────────────────────────┘

Workflow Components

1. Triggers

What starts the workflow?

Trigger TypeDescriptionExample
ManualUser explicitly starts workflow"Run lead qualification"
ScheduleTime-based triggerEvery Monday at 9 AM
EventSystem event triggerNew email received, CRM update
WebhookExternal system triggerGitHub push, Slack message
API CallProgrammatic triggerREST API, SDK call
ConditionData-based triggerWhen opportunity value > $10K

Trigger Examples

triggers:
  - type: manual
    name: run_lead_qualification
    description: "Qualify a new lead"
    
  - type: schedule
    cron: "0 9 * * 1-5"
    name: daily_standup
    description: "Daily team standup workflow"
    
  - type: event
    source: crm
    event: new_lead
    name: auto_qualify_lead
    
  - type: webhook
    endpoint: /webhooks/github
    event: push
    name: code_review_workflow
    
  - type: condition
    condition: "opportunity.value > 10000"
    name: high_value_opportunity

2. Steps

What actions does the workflow perform?

Each step can:

  • Call an agent
  • Use a tool
  • Make a decision
  • Wait for input
  • Loop or branch

Step Types

Step TypeDescriptionExample
Agent CallInvoke an agent"Call Lead Agent to qualify"
Tool CallUse a tool"Query CRM for customer data"
DecisionConditional logic"If score > 80, route to AE"
WaitPause execution"Wait for user approval"
LoopRepeat steps"For each lead in list"
ParallelConcurrent steps"Run analysis and enrichment simultaneously"

Step Examples

steps:
  - name: enrich_lead_data
    type: agent
    agent: enrichment_agent
    parameters:
      lead_id: "{{lead.id}}"
    
  - name: calculate_score
    type: agent
    agent: scoring_agent
    parameters:
      lead_data: "{{steps.enrich_lead_data.output}}"
    
  - name: route_decision
    type: decision
    condition: "{{steps.calculate_score.output.score}} > 80"
    true_step: route_to_ae
    false_step: route_to_sdr
    
  - name: route_to_ae
    type: tool
    tool: crm.assign
    parameters:
      lead_id: "{{lead.id}}"
      owner: "account_executive"

3. Variables & Inputs

What data does the workflow use?

Variable Types

TypeDescriptionExample
InputProvided when workflow startslead_id, customer_name
OutputGenerated by workflow stepsqualified_score, assigned_owner
ContextFrom Spine Fabriccustomer_history, previous_interactions
ConstantFixed valuespriority_threshold = 80
ComputedCalculated during executiontotal_value = sum(items)

Variable Examples

variables:
  inputs:
    lead_id:
      type: string
      required: true
      description: "The ID of the lead to qualify"
    source:
      type: string
      default: "web_form"
      description: "Where the lead came from"
    
  outputs:
    qualified:
      type: boolean
      description: "Whether the lead was qualified"
    score:
      type: number
      description: "The lead qualification score"
    assigned_to:
      type: string
      description: "Who the lead was assigned to"
    
  context:
    customer_data: "{{spine.crm.customers[lead.customer_id]}}"
    previous_leads: "{{spine.crm.leads[customer_id=lead.customer_id]}}"

4. Governance

What rules apply to the workflow?

Governance AspectDescriptionExample
PermissionsWhat the workflow can accesscrm:read, email:send
ApprovalsWhat requires human approvalHigh-value assignments
Rate LimitsExecution constraintsMax 10 concurrent executions
AuditWhat gets loggedAll steps, decisions, data access
TimeoutsExecution limitsComplete within 1 hour

Governance Examples

governance:
  permissions:
    required: [crm:read, crm:write, email:send]
    optional: [calendar:read]
    
  approvals:
    required_for:
      - data_modification
      - external_communication
      - high_value_actions
    approvers:
      - user
      - manager
    
  rate_limits:
    max_concurrent: 10
    max_per_hour: 100
    
  audit:
    log_all_steps: true
    log_data_access: true
    log_decisions: true
    
  timeouts:
    step_timeout: 300  # 5 minutes per step
    workflow_timeout: 3600  # 1 hour total

Workflow Examples

Example 1: Lead Qualification Workflow

name: lead_qualification
version: 1.0
description: "Automatically qualify inbound leads"

triggers:
  - type: event
    source: crm
    event: new_lead

variables:
  inputs:
    lead_id:
      type: string
      required: true

steps:
  # Step 1: Enrich lead data
  - name: enrich_lead
    type: agent
    agent: enrichment_agent
    parameters:
      lead_id: "{{inputs.lead_id}}"
    output: enriched_lead

  # Step 2: Calculate qualification score
  - name: calculate_score
    type: agent
    agent: scoring_agent
    parameters:
      lead: "{{steps.enrich_lead.output}}"
    output: score

  # Step 3: Route based on score
  - name: route_decision
    type: decision
    condition: "{{steps.calculate_score.output.score}} > 80"
    true_step: route_to_ae
    false_step: route_to_sdr

  # Step 4a: Route to Account Executive
  - name: route_to_ae
    type: agent
    agent: router_agent
    parameters:
      lead_id: "{{inputs.lead_id}}"
      role: "account_executive"
      priority: "high"

  # Step 4b: Route to SDR
  - name: route_to_sdr
    type: agent
    agent: router_agent
    parameters:
      lead_id: "{{inputs.lead_id}}"
      role: "sdr"
      priority: "normal"

  # Step 5: Notify owner
  - name: notify_owner
    type: tool
    tool: email.send
    parameters:
      to: "{{steps.route_decision.output.owner.email}}"
      subject: "New lead assigned: {{steps.enrich_lead.output.company_name}}"
      body: "You have a new lead to follow up on..."

governance:
  approvals:
    required_for: external_communication

Example 2: Daily Planning Workflow

name: daily_planning
version: 1.0
description: "Plan your day based on tasks, meetings, and priorities"

triggers:
  - type: schedule
    cron: "0 8 * * 1-5"

variables:
  outputs:
    schedule:
      type: object
      description: "Your optimized daily schedule"
    priorities:
      type: array
      description: "Today's top priorities"

steps:
  # Step 1: Get today's meetings
  - name: get_meetings
    type: tool
    tool: calendar.list
    parameters:
      date: "{{today}}"
    output: meetings

  # Step 2: Get outstanding tasks
  - name: get_tasks
    type: tool
    tool: tasks.list
    parameters:
      status: "incomplete"
      due_before: "{{tomorrow}}"
    output: tasks

  # Step 3: Analyze priorities
  - name: analyze_priorities
    type: agent
    agent: priority_agent
    parameters:
      meetings: "{{steps.get_meetings.output}}"
      tasks: "{{steps.get_tasks.output}}"
      calendar: "{{spine.calendar}}"
    output: priorities

  # Step 4: Create optimized schedule
  - name: create_schedule
    type: agent
    agent: scheduling_agent
    parameters:
      priorities: "{{steps.analyze_priorities.output}}"
      meetings: "{{steps.get_meetings.output}}"
      constraints: "{{user.preferences.constraints}}"
    output: schedule

  # Step 5: Send daily briefing
  - name: send_briefing
    type: tool
    tool: email.send
    parameters:
      to: "{{user.email}}"
      subject: "Your daily plan for {{today}}"
      body: "{{steps.create_schedule.output.summary}}"

governance:
  permissions:
    required: [calendar:read, tasks:read, email:send]

Example 3: Customer Support Triage

name: support_triage
version: 1.0
description: "Route and prioritize incoming support tickets"

triggers:
  - type: event
    source: support_system
    event: new_ticket

variables:
  inputs:
    ticket_id:
      type: string
      required: true

steps:
  # Step 1: Get ticket details
  - name: get_ticket
    type: tool
    tool: support.read
    parameters:
      ticket_id: "{{inputs.ticket_id}}"
    output: ticket

  # Step 2: Analyze ticket
  - name: analyze_ticket
    type: agent
    agent: support_analyzer
    parameters:
      ticket: "{{steps.get_ticket.output}}"
      customer_history: "{{spine.crm.customers[ticket.customer_id].interactions}}"
    output: analysis

  # Step 3: Determine priority
  - name: determine_priority
    type: agent
    agent: priority_agent
    parameters:
      analysis: "{{steps.analyze_ticket.output}}"
      customer_tier: "{{spine.crm.customers[ticket.customer_id].tier}}"
    output: priority

  # Step 4: Route to appropriate team
  - name: route_ticket
    type: decision
    condition: "{{steps.determine_priority.output}} == 'urgent'"
    true_step: route_to_tier1_urgent
    false_step: route_by_category

  # Step 4a: Urgent to Tier 1
  - name: route_to_tier1_urgent
    type: tool
    tool: support.assign
    parameters:
      ticket_id: "{{inputs.ticket_id}}"
      team: "tier1"
      priority: "urgent"

  # Step 4b: Route by category
  - name: route_by_category
    type: decision
    condition: "{{steps.analyze_ticket.output.category}} == 'technical'"
    true_step: route_to_technical
    false_step: route_to_general

  # Step 4c: Route to Technical
  - name: route_to_technical
    type: tool
    tool: support.assign
    parameters:
      ticket_id: "{{inputs.ticket_id}}"
      team: "technical"
      priority: "{{steps.determine_priority.output}}"

  # Step 4d: Route to General
  - name: route_to_general
    type: tool
    tool: support.assign
    parameters:
      ticket_id: "{{inputs.ticket_id}}"
      team: "general"
      priority: "{{steps.determine_priority.output}}"

  # Step 5: Notify assignee
  - name: notify_assignee
    type: tool
    tool: slack.send
    parameters:
      channel: "{{steps.route_ticket.output.assignee.slack_channel}}"
      message: "New ticket assigned: {{steps.get_ticket.output.subject}}"

governance:
  approvals:
    required_for: high_priority_assignments
  audit:
    log_all_data_access: true

Workflow Lifecycle

1. Definition

Create and configure the workflow

# Create a new workflow
integratewise workflow create lead_qualification.yaml

# Validate the workflow
integratewise workflow validate lead_qualification

# Update an existing workflow
integratewise workflow update lead_qualification --version 2.0

2. Testing

Test the workflow before production use

# Test with sample data
integratewise workflow test lead_qualification --input '{"lead_id": "test_123"}'

# Dry run (no actual execution)
integratewise workflow test lead_qualification --dry-run --input '{"lead_id": "test_123"}'

# Step-by-step testing
integratewise workflow test lead_qualification --step-by-step --input '{"lead_id": "test_123"}'

3. Deployment

Deploy the workflow to production

# Deploy workflow
integratewise workflow deploy lead_qualification

# Check deployment status
integratewise workflow status lead_qualification

# Rollback to previous version
integratewise workflow rollback lead_qualification --version 1.0

4. Execution

Run the workflow

# Manual execution
integratewise workflow run lead_qualification --input '{"lead_id": "lead_456"}'

# Check execution status
integratewise workflow execution status execution_123

# View execution logs
integratewise workflow execution logs execution_123

5. Monitoring

Monitor workflow performance

# View workflow metrics
integratewise workflow metrics lead_qualification

# View execution history
integratewise workflow history lead_qualification --limit 100

# Set up alerts
integratewise workflow alert create lead_qualification --condition "error_rate > 0.05"

6. Optimization

Improve the workflow over time

# Analyze performance
integratewise workflow analyze lead_qualification

# View suggestions
integratewise workflow suggest lead_qualification

# Optimize automatically
integratewise workflow optimize lead_qualification --auto

Workflow Patterns

1. Linear Workflow

Sequential steps, one after another

Step 1 → Step 2 → Step 3 → Step 4 → Result

Use Case: Simple, predictable processes
Example: Document approval workflow

2. Conditional Workflow

Branching based on conditions

Step 1
   │
   ├── Condition A → Step 2a → Step 3a
   └── Condition B → Step 2b → Step 3b

Use Case: Different paths based on data
Example: Lead routing based on score

3. Parallel Workflow

Multiple steps executed simultaneously

Step 1
   │
   ├── Step 2a
   ├── Step 2b
   └── Step 2c
   │
   └── Step 3 (aggregate results)

Use Case: Independent tasks that can run in parallel
Example: Customer 360 assembly (gather data from multiple sources)

4. Loop Workflow

Repeat steps for multiple items

Step 1 (initialize)
   │
   ▼
Step 2 (process item)
   │
   ├── More items? → Loop back to Step 2
   └── No more items → Step 3

Use Case: Batch processing
Example: Process all leads in a list

5. Nested Workflow

Workflows calling other workflows

Main Workflow
   │
   └── Step 1: Call Sub-Workflow A
           │
           └── Sub-Workflow A (complete workflow)
   │
   └── Step 2: Call Sub-Workflow B
           │
           └── Sub-Workflow B (complete workflow)

Use Case: Modular, reusable workflows
Example: Customer onboarding (calls identity verification, provisioning, notification workflows)

6. Event-Driven Workflow

Workflow triggered by and responding to events

Event 1 → Step 1 → Step 2 → Wait for Event 2 → Step 3 → Step 4

Use Case: Reactive, real-time processes
Example: Incident response (triggered by alert, waits for resolution)

Best Practices

Workflow Design

  1. Start Simple

    • Begin with linear workflows
    • Add complexity gradually
    • Test at each stage
  2. Modularize

    • Break complex workflows into sub-workflows
    • Reuse common patterns
    • Keep workflows focused on single responsibilities
  3. Handle Errors

    • Define error handling for each step
    • Use retries for transient failures
    • Provide fallbacks when possible
    • Notify on critical failures
  4. Maintain Context

    • Pass context between all steps
    • Store intermediate results
    • Make context available for debugging
  5. Optimize Performance

    • Use parallel steps where possible
    • Cache expensive operations
    • Minimize external API calls
    • Batch similar operations

Workflow Management

  1. Version Control

    • Version all workflows
    • Maintain changelog
    • Test before deploying new versions
    • Support rollback capability
  2. Monitoring

    • Track all executions
    • Monitor performance metrics
    • Set up alerts for issues
    • Review logs regularly
  3. Documentation

    • Document purpose and usage
    • Define inputs and outputs
    • Document governance and permissions
    • Provide examples
  4. Security

    • Follow principle of least privilege
    • Require approvals for sensitive actions
    • Audit all workflow activities
    • Encrypt sensitive data
  5. Iteration

    • Review usage patterns
    • Gather user feedback
    • Continuously improve
    • Deprecate unused workflows

Monitoring & Analytics

Workflow Metrics

MetricDescriptionTarget
ExecutionsTotal workflow executionsTrack growth
Success Rate% of successful executions>95%
Error Rate% of failed executions<5%
Execution TimeAverage time to completeMinimize
Steps ExecutedTotal steps across all executionsTrack usage
Parallel Steps% of steps executed in parallelMaximize
Context Usage% of executions using stored context>80%

Workflow Dashboard

The Workflow Dashboard provides:

  • Real-time execution view
  • Success/error rates
  • Performance metrics
  • Execution history
  • Resource usage
  • Alert status

Alerts

Configure alerts for:

  • High error rates
  • Slow execution times
  • Permission violations
  • Resource limitations
  • Unusual patterns

Security & Governance

Permission Model

Workflows operate within a hierarchical permission model:

Workflow Level → Step Level → Tool/Agent Level
     ↓              ↓             ↓
  Workflow        Step         Specific
  Permissions     Permissions  Permissions

Approval Workflows

For sensitive operations, workflows can require:

  • Auto-Approve - Low-risk operations
  • Notify-Only - Execute and notify
  • HITL Required - Human approval needed
  • Multi-Level Approval - Multiple approvals required

Audit Trails

All workflow executions are logged with:

  • Execution ID and timestamp
  • Workflow name and version
  • Inputs and outputs
  • Step-by-step execution log
  • Data accessed and modified
  • User approvals (if applicable)
  • Errors and exceptions

Troubleshooting

Common Issues

IssueCauseSolution
Workflow not startingTrigger misconfigurationCheck trigger definition and source
Step failingPermission issueReview step permissions and access
Slow executionSerial steps, external APIsAdd parallelism, cache results
Context missingNot passed between stepsVerify context passing in workflow
HangingWaiting for input or approvalCheck for pending approvals

Debug Mode

Enable debug mode for workflow troubleshooting:

# Enable debug for workflow
integratewise workflow debug lead_qualification --level verbose

# View execution details
integratewise workflow execution show execution_123 --debug

# Test with full logging
integratewise workflow test lead_qualification --debug --input '{"lead_id": "test"}'

Roadmap

Short-term (0-3 months)

  • Enhanced workflow editor (visual + code)
  • More workflow templates and examples
  • Improved error handling and recovery
  • Better parallel execution

Medium-term (3-6 months)

  • AI-powered workflow suggestions
  • Predictive workflow optimization
  • Advanced conditional logic
  • Cross-workflow coordination

Long-term (6-12 months)

  • Autonomous workflow adaptation
  • Self-optimizing workflows
  • Natural language workflow definition
  • Advanced workflow analytics

Support

Documentation

Community

Professional Services


Quick Reference

Workflow in One Sentence

Workflows are automated processes that coordinate agents, tools, and systems to complete complex tasks efficiently and consistently.

Key Concepts

  • Trigger - What starts the workflow
  • Steps - What actions the workflow performs
  • Variables - What data the workflow uses
  • Governance - What rules apply to the workflow

Workflow Types

  1. Personal Workflows - Individual productivity
  2. Team Workflows - Collaborative processes
  3. Domain Workflows - Business function automation
  4. Cross-Domain Workflows - Multi-function coordination
  5. System Workflows - Platform operations

Next Steps

  1. Explore Agent Network
  2. Learn about Core Agents
  3. Browse Domain Agents
  4. Understand Network Effect
  5. Create your first workflow