▾
ESM
import { SequentialWorkflow } from "@arcgis/ai-components/agent-utils/workflows/SequentialWorkflow.js";- Inheritance
- SequentialWorkflow→
BaseWorkflow<TState>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
SequentialWorkflow executes agents in strict linear order.
Use in the following scenarios:
- Later steps depend on values produced by earlier steps,
- You want a simple linear pipeline.
How it works:
- First agent runs and passes shared state forward,
- Each subsequent agent receives the updated shared state from the previous agent,
- Run agent 2, then agent 3, and so on,
- Stops early when an agent returns a failed status,
- Stop after the final agent in the sequence runs.
Constructors
Properties
| Property | Type | Class |
|---|---|---|
| |
Methods
| Method | Signature | Class |
|---|---|---|
| protected | buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[] | |
| inherited protected | buildNodes(agents: BaseAgentLike<TState>[]): GraphNodes<AgentGraphState<TState>> | |
| inherited | generate(parameter0?: WorkflowGenerateOptions<TState>): WorkflowGenerateResult<TState> | |
| getAgents(): BaseAgentLike<TState>[] | | |
| protected | getEntryNode(agents: BaseAgentLike<TState>[]): string | undefined | |
| protected | isTerminalAgent(agents: BaseAgentLike<TState>[], index: number): boolean | |
| protected | validateAgents(agents: BaseAgentLike<TState>[]): void | |
buildEdges
protected Method
- Signature
-
buildEdges (agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[]
Builds the workflow-specific edges.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| agents | | |
- Returns
- GraphEdge<AgentGraphState
>[]
buildNodes
inheritedprotected Method
- Signature
-
buildNodes (agents: BaseAgentLike<TState>[]): GraphNodes<AgentGraphState<TState>>
Inherited from: BaseWorkflow
Builds the workflow's graph nodes.
Node ids use the agent id plus its position (agent.id_index) instead of only the raw
agent id. That prevents collisions when the same agent instance is used multiple times.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| agents | | |
- Returns
- GraphNodes<AgentGraphState
>
generate
inherited Method
- Signature
-
generate (parameter0?: WorkflowGenerateOptions<TState>): WorkflowGenerateResult<TState>
Inherited from: BaseWorkflow
Generates the workflow's graph and shared workspace based on its agents and optional boundary schemas.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| parameter0 | | |
- Returns
- WorkflowGenerateResult
getAgents
Method
- Signature
-
getAgents (): BaseAgentLike<TState>[]
Returns the agents coordinated by this workflow.
- Returns
- BaseAgentLike
[]
isTerminalAgent
protected Method
- Signature
-
isTerminalAgent (agents: BaseAgentLike<TState>[], index: number): boolean
Indicates whether the agent at index is terminal and should expose terminal runtime fields in workflow state.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| agents | | | |
| index | | |
- Returns
- boolean
validateAgents
protected Method
- Signature
-
validateAgents (agents: BaseAgentLike<TState>[]): void
Throws if the workflow contains no agents. Concrete workflow classes may add validation for their requirements.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| agents | | |
- Returns
- void
Type definitions
SequentialWorkflowConstructProperties
Type definition
- Type parameters
- <TState extends AgentData>
- Supertypes
- Pick<SequentialWorkflow
‚ "agents">