<!-- description: A workflow is a defined sequence of steps that an AI agent follows to complete a task, specifying the order of actions, decision points, and human touchpoints across the process. -->

# Workflow

A **workflow** is a defined sequence of steps that an AI [agent](agent) follows to complete a task. Workflows specify the order of actions, decision points, tool calls, and [human-in-the-loop](human-in-the-loop) touchpoints that guide an agent from a starting state to a desired outcome.

## Workflows vs. Agentic Workflows

The term *workflow* is broad. In the context of AI agents, an [agentic workflow](agentic-workflow) is a workflow where the agent has autonomy to decide its own path rather than following a rigid script.

| Type | Agent Freedom | Human Involvement |
|------|--------------|------------------|
| Scripted workflow | Follows fixed steps | Defined checkpoints |
| Agentic workflow | Adapts based on results | Dynamic oversight |

## Components of an Agent Workflow

A typical agent workflow includes:

1. **Trigger** — An event or instruction that starts the workflow
2. **Planning** — The agent determines the approach
3. **Execution** — The agent runs tools and produces outputs
4. **Checkpoints** — Points where the agent pauses for human [approval](approval) or input
5. **Completion** — The agent signals the workflow is done

## Designing Workflows with AgentRQ

AgentRQ enables you to build [human-in-the-loop](human-in-the-loop) workflows for [Claude Code](claude-code) agents. A well-designed AgentRQ workflow looks like:

1. Agent receives a task (e.g., "implement OAuth login")
2. Agent calls `getWorkspace` to understand project context
3. Agent creates a [task](task) via `createTask` with status `ongoing`
4. Agent works autonomously — reading code, writing implementation
5. Agent sends [notification](notification) via `reply` when it reaches a decision point
6. Human reviews and responds
7. Agent continues to completion
8. Agent calls `updateTaskStatus` to mark the task `completed`

## Related Terms

- [Agentic Workflow](agentic-workflow)
- [Task](task)
- [Human-in-the-Loop](human-in-the-loop)
- [Approval](approval)
- [Agent](agent)
