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.

graph TD A[HTTP Node] --> B[HTTP Node] B --> C[HTTP Node] D[Error Boundary] -.Protects.-> A D -.Protects.-> B E[Agent Node] --> F[Tool Node] E --> G[HTTP Node] style A fill:#4299E1,stroke:#2B6CB0 style B fill:#4299E1,stroke:#2B6CB0 style C fill:#4299E1,stroke:#2B6CB0 style D fill:#F56565,stroke:#C53030 style E fill:#48BB78,stroke:#2F855A style F fill:#9F7AEA,stroke:#6B46C1 style G fill:#4299E1,stroke:#2B6CB0
TLDR

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.

See Retry and Durability Configurations

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.

Flow Control and Conditional Execution

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 Schema

Node 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.

View Complete Error Boundary Node Schema

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.

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.

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.