Inferensys

Glossary

Activity

An activity is a discrete, executable unit of work within a workflow, such as a function call, API request, or human task, invoked by a workflow engine.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
ORCHESTRATION WORKFLOW ENGINES

What is an Activity?

In workflow orchestration, an activity is the fundamental, executable unit of work.

An activity is a discrete, executable unit of work within a workflow, such as a function call, API request, or human task, which is invoked by the workflow engine. It represents a single, often idempotent, operation that advances the workflow's state. Activities are the building blocks of a workflow definition, which structures them into a sequence or graph using patterns like conditional branching and parallel execution. The engine manages their execution, handling retries, state persistence, and communication.

Activities are designed to be stateless, with all necessary context provided by the workflow engine via input parameters. Their outputs are captured as workflow variables. This separation allows the orchestration layer to manage complex control flow, error handling via retry logic, and distributed transactions using patterns like the Saga pattern, while activities focus solely on business logic execution. Common examples include calling a microservice, querying a database, or sending a notification.

ORCHESTRATION WORKFLOW ENGINES

Key Characteristics of an Activity

An activity is the fundamental, executable building block within a workflow. Understanding its core properties is essential for designing reliable and scalable orchestrated systems.

01

Discrete Unit of Work

An activity is a discrete, self-contained operation that performs a specific function. It represents a single step in a larger workflow, such as:

  • Calling a function or method.
  • Making an API request to an external service.
  • Executing a database query.
  • Performing a human-in-the-loop task (e.g., approval request). Its atomic nature allows the workflow engine to manage its execution, state, and failure independently of other steps.
02

Stateless by Design

Activities are typically designed to be stateless. They receive all necessary input data as parameters and return a result, but do not retain internal state between invocations. This design principle enables:

  • Idempotent execution: The same activity can be safely retried without causing side effects.
  • Horizontal scalability: Multiple instances of the same activity can run in parallel.
  • Simplified recovery: The workflow engine, not the activity, is responsible for persisting and managing execution state, making failure recovery more deterministic.
03

Engine-Invoked Execution

Activities are invoked by the workflow engine, not initiated autonomously. The engine acts as the central coordinator, responsible for:

  • Scheduling: Determining when an activity is ready to run based on workflow logic and dependencies.
  • Dispatching: Sending the activity for execution, often to a separate worker process or service.
  • Lifecycle Management: Tracking the activity's status (pending, running, completed, failed). This inversion of control is a hallmark of orchestration, distinguishing it from choreographed, peer-to-peer agent communication.
04

Defined Inputs and Outputs

Every activity has a strictly defined interface specifying its required inputs and produced outputs. This contract is crucial for:

  • Type Safety: Ensuring data passed between activities is valid and structured.
  • Dependency Management: Allowing the engine to resolve data flow; the output of one activity can be the input to another.
  • Composability: Enabling activities to be reused and combined in different workflows. Inputs are often serialized (e.g., as JSON) for transmission, and outputs are captured by the engine for state progression.
05

Configurable Execution Policies

Activities are governed by execution policies defined at the workflow or activity level. These policies dictate how the engine handles non-ideal conditions, including:

  • Retry Logic: Automatically re-executing the activity on failure with configurable delays (e.g., exponential backoff) and maximum attempts.
  • Timeouts: Setting a maximum duration for an activity to complete before it is considered failed.
  • Circuit Breakers: Temporarily halting calls to an activity if it fails repeatedly, allowing downstream issues to resolve. These policies are essential for building resilient, production-grade workflows.
06

Observable and Traceable

Activities are primary sources of observability data within an orchestrated system. The workflow engine instruments each activity to provide:

  • Execution Logs: Detailed records of start/end times, inputs, outputs, and any errors.
  • Metrics: Performance data such as duration, success/failure rates, and queue times.
  • Distributed Traces: Correlation IDs that link an activity's execution to the broader workflow instance. This telemetry is critical for debugging, performance optimization, and maintaining an audit trail for compliance.
ORCHESTRATION WORKFLOW ENGINES

Frequently Asked Questions

Common questions about activities, the fundamental executable units within a workflow orchestration engine.

An activity is a discrete, executable unit of work within a workflow, such as a function call, API request, or human task, which is invoked by the workflow engine. It represents a single, atomic operation in a larger business process. Unlike the workflow engine that manages control flow and state, an activity contains the business logic to perform a specific job, like processing a payment, sending an email, or running a data transformation. Activities are designed to be idempotent, meaning they can be safely retried in case of failure without causing unintended side effects. They are the building blocks that a task orchestrator sequences according to the workflow definition.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.