Workflows are powerful automation tools in the Thena Platform that enable you to create, manage, and execute complex business processes across various applications. They serve as the foundation for automating repetitive tasks, ensuring consistency, and improving operational efficiency.

Understanding workflows

Core purpose

A centralized system for automating business processes, managing event-driven operations, and orchestrating activities across the platform. Workflows serve as the backbone for all automation needs.

Key features

• Event-driven automation
• Complex conditional logic
• Multi-step processes
• Error handling and compensation

Integration capabilities

• Cross-app automation
• Custom activity support
• API-first architecture

Workflows form the automation engine of the Thena Platform, connecting various components like tickets, teams, accounts, and other platform features into cohesive automated processes.

Core capabilities

Event processing

• Event registration
• Trigger conditions
• Event filtering
• Real-time processing

Activity management

• System activities
• Custom activities
• Activity chaining
• Error handling
• Compensation logic

Standard components

All workflow components can be customized and extended based on your business requirements through the API.

Events

TypeDescriptionExamples
System EventsPlatform-generated events• Ticket comment updated (ticket:comment:updated): Triggered when a comment is updated, contains previous and new content
• Ticket archived (ticket:archived): Triggered when a ticket is moved to archived status
• Ticket escalated (ticket:escalated): Triggered when a ticket is escalated
Integration EventsEvents from integrated apps• Slack message (slack:message): Triggered when a message is sent in a channel
• Slack channel created (slack:channel:created): Triggered when a new channel is created
Timer EventsSchedule-based events• Daily report generation (schedule:daily)
• Weekly cleanup (schedule:weekly)
• Custom intervals (cron:custom)

Activities

TypeDescriptionExamples
System ActivitiesBuilt-in platform activities• Create account (accounts:create-account-platform): Creates new account with name and domain
• Sleep (workflows:sleep-platform): Pauses execution for specified duration
• Update ticket (tickets:update-ticket-platform): Updates ticket information
Integration ActivitiesActivities for external services• Slack postMessage (slack.postMessage-YKGGEBQJ10VM380KWBSKVYP875AJQ-EUUV8TTGY1): Sends messages to Slack channels
Data ActivitiesData manipulation activities• Get comment threads (communications:get-comment-threads-platform): Retrieves threaded comments for specific IDs

Associated components

Workflow structure

The platform enforces workflow execution rules:

  • Sequential activity execution
  • Automatic compensation on failure
  • Error handling at each step
  • State management throughout execution

API examples

Create a workflow

curl -X POST https://api.thena.ai/v1/workflows \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "High Priority Ticket Handler",
    "trigger": {
      "event": "ticket:created",
      "conditions": {
        "priority": "high"
      }
    },
    "activities": [
      {
        "name": "notify_team",
        "params": {
          "channel": "slack",
          "message": "New high priority ticket created"
        }
      },
      {
        "name": "assign_agent",
        "params": {
          "team": "support"
        }
      }
    ]
  }'

List workflows

curl -X GET https://api.thena.ai/v1/workflows \
  -H "Authorization: Bearer YOUR_API_KEY"

Best practices

1

Design principles

  • Keep workflows focused and single-purpose
  • Implement proper error handling
  • Use appropriate compensation strategies
  • Monitor workflow performance
2

Security

  • Follow least privilege principle
  • Secure sensitive data
  • Audit workflow executions
3

Maintenance

  • Document workflow purposes
  • Monitor execution metrics
  • Regular performance reviews
  • Update workflows as needed

Next steps