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.
Glossary
Activity

What is an Activity?
In workflow orchestration, an activity is the fundamental, executable unit of work.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
An activity is a fundamental building block within a workflow. To fully understand its role, it's essential to explore the related concepts that define, manage, and execute these units of work.
Workflow Engine
A workflow engine is the core software component that executes predefined sequences of tasks. It is responsible for:
- Managing state across the entire workflow instance.
- Routing data between activities.
- Invoking activities according to the defined model or script.
- Handling conditional logic, parallel execution, and error recovery. Popular examples include Apache Airflow, Temporal, and AWS Step Functions.
Task
A task is a broader, often more abstract, unit of work that an agent or system must complete. An activity is a specific type of task that is formally defined and invoked by the workflow engine. Key distinctions:
- Granularity: A task can be high-level (e.g., 'process invoice'), while an activity is a concrete step (e.g., 'call PDF parsing API').
- Orchestration: Activities are explicitly managed by the engine; tasks may be delegated to agents with autonomy.
- Scope: In systems like Apache Airflow, a 'task' is the node in a DAG, which executes an 'operator'—the implementation of the activity.
Process Instance
A process instance is a single, specific execution of a workflow definition. It is the runtime manifestation where activities are executed. Each instance:
- Maintains its own isolated state and variables.
- Has a unique execution history and lifecycle.
- Can run concurrently with other instances of the same workflow.
- Is what the workflow engine schedules, monitors, and persists. For example, triggering a 'Customer Onboarding' workflow for each new user creates a separate process instance.
Directed Acyclic Graph (DAG)
A DAG is the primary data structure used to model workflows. It defines the activities and their dependencies.
- Nodes represent activities or tasks.
- Directed Edges represent dependencies (e.g., Activity B requires Activity A to finish first).
- Acyclic means no loops or circular dependencies, ensuring a finite execution path. This structure allows the engine to calculate execution order, identify parallelizable paths, and visualize the workflow. Apache Airflow uses DAGs as its core abstraction.
State Machine
A state machine is a computational model used to define workflow logic, especially for complex, event-driven processes. It models a workflow as:
- A finite set of states (e.g., 'Pending', 'Running', 'Completed', 'Failed').
- Transitions between states triggered by events or activity completions.
- Actions executed on transitions or within states. This model is excellent for representing business processes with clear stages and decision points. AWS Step Functions implements workflows as state machines using the Amazon States Language (ASL).
Task Queue
A task queue is a buffering and messaging mechanism that decouples activity submission from execution. It is critical for scalable and reliable orchestration.
- Decoupling: The workflow engine places activities in the queue; worker processes pull from it asynchronously.
- Load Leveling: Prevents system overload by smoothing out bursts of activity.
- Reliability: Provides durability; tasks persist in the queue until a worker acknowledges completion.
- Scalability: Allows dynamic scaling of worker pools. Technologies like Redis, RabbitMQ, or Apache Kafka are commonly used as task queue backends.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us