Node Types
Graph Compose provides different types of nodes to build powerful HTTP workflows. Each node type represents an endpoint that you implement, while Graph Compose handles the orchestration and communication between these endpoints.
All nodes in Graph Compose represent HTTP endpoints that you own and implement. The node definitions in your workflow specify how Graph Compose should interact with these endpoints, including the expected request/response format, retry behavior, and error handling.
Node Types at a Glance
HTTP Nodes
Your HTTP endpoints that handle standard request/response interactions
Error Boundaries
Your endpoints that handle error recovery for other nodes
Agent Nodes
Your AI-powered endpoints that can use tools and make decisions Learn more
Tool Nodes
Your endpoints that provide specific capabilities to agent nodes Learn more
Common Configuration Options
Each node type in Graph Compose can be configured independently with powerful options to control its behavior. Below are key configuration sections you may want to explore:
Retry/Durability Configurations
Each node can be configured at runtime to control it's retry behavior, the number of retries, the backoff strategy, and more. This is useful for ensuring that your workflow is reliable and can recover from failures.
As an example, you may need to make many HTTP requests to external services to complete a workflow. If any of those requests fail, for example with a 429
error, you can easily work around this by configuring a retry strategy for guaranteed execution.
Flow Control and Conditional Execution
Nodes also can have conditional logic to control the flow of the workflow based on the result of the node. If you want to learn more about how to control the flow of the workflow, check out the link below.
An example of when you might want to use conditional logic is if you want to terminate
a workflow if a certain condition is met.
HTTP Nodes
HTTP nodes define how Graph Compose should interact with your standard HTTP endpoints. You implement the endpoint, and Graph Compose handles the orchestration, retry logic, and data flow based on this definition.
View Complete HTTP Node SchemaNode Definition Examples
import { GraphCompose } from '@graph-compose/client';
const workflow = new GraphCompose()
.node('get_user')
.dependsOn('auth')
.get('https://api.example.com/users/{{context.userId}}')
.withHeaders({
'Authorization': 'Bearer {{results.auth.token}}'
})
.end();
Error Boundary Nodes
Error boundary nodes define special error handling endpoints. When a node protected by an error boundary fails, Graph Compose will invoke the HTTP endpoint defined in the error boundary definition, passing along error details.
Your error boundary endpoint will receive both the errorContext
object and any data specified in the body
of the error boundary definition. The results of the failed node itself will not be available.
Error Boundary Examples
import { GraphCompose } from '@graph-compose/client';
const workflow = new GraphCompose()
.errorBoundary('payment_error_handler', ['process_payment'])
.post('https://api.example.com/payment/rollback')
.end();
Agentic Nodes
Agentic nodes define AI-powered endpoints in your workflow. Implementing an agent node involves handling context, goals, decision-making, and potentially invoking other nodes defined as Tools or Sub-Graphs.
Agent endpoints must implement the agent execution contract defined by Graph Compose. See the Agent Documentation for detailed implementation requirements.
For a more comprehensive guide on implementing and using agents, including detailed examples and the execution contract, please see the main Agent Documentation.
Tool Nodes
Tool nodes represent specific tools or capabilities (defined as HTTP endpoints) that can be invoked by Agentic nodes as part of their decision-making process.
Graph Nodes (Sub-Graphs)
Graph nodes define reusable sub-graphs that can be invoked, primarily used within Agentic workflows to encapsulate complex logic or sequences.
Looking for Information on Agentic Nodes?
Discover how to implement agents, understand their execution contract, and see advanced examples in our dedicated agent documentation.
Iterator Nodes
Iterator nodes are used for looping constructs within a workflow, allowing you to repeat a set of tasks based on data or conditions.
Currently, Iterator nodes can only be configured via the Visual Builder.
Destination Nodes
Destination nodes represent the final output or terminal endpoint of a workflow branch. They signify the completion of a specific path within the workflow.
Currently, Destination nodes can only be configured via the Visual Builder.