PipesConcepts
Node types
Triggers, logic nodes, action nodes, and AI agent nodes that compose Pipes workflows
Every Pipes workflow is a directed graph of nodes. Each node has a single responsibility: receive input, process it, and pass output to the next node. Nodes are grouped into four categories.
Trigger nodes
Triggers start a workflow execution. Every workflow needs exactly one trigger.
| Node | Description | Use case |
|---|---|---|
| Event | Fires when a message is published to a channel | React to business events |
| Schedule | Fires on a cron schedule or fixed interval | Periodic batch processing |
| Webhook | Fires when an HTTP request is received | External system integration |
| Manual | Fires when triggered by a user or API call | On-demand processing |
| Form | Fires when a form submission is received | User input workflows |
| npayload | Fires on internal npayload events (subscription, DLQ) | Platform automation |
| nthread | Fires on agent session events | AI agent orchestration |
Example: event trigger
const workflow = await npayload.pipes.create({
name: 'order-processor',
trigger: {
type: 'event',
channel: 'orders',
filter: { event: 'order.created' },
},
});Example: schedule trigger
const workflow = await npayload.pipes.create({
name: 'daily-report',
trigger: {
type: 'schedule',
cron: '0 9 * * *', // Every day at 9 AM
},
});Logic nodes
Logic nodes control flow, transform data, and make decisions.
| Node | Description | Use case |
|---|---|---|
| Condition | If/else branching based on expressions | Route by event type |
| Switch | Multi-way branching (like switch/case) | Route by category |
| Loop | Iterate over arrays or repeat until condition | Batch processing |
| Delay | Wait for a duration before continuing | Rate limiting, scheduling |
| Parallel | Execute multiple branches simultaneously | Fan-out processing |
| Merge | Wait for multiple branches to complete | Fan-in aggregation |
| Filter | Drop messages that do not match criteria | Noise reduction |
| Transform | Reshape, map, or enrich payloads | Data normalization |
Example: condition node
workflow.addNode({
type: 'condition',
expression: '{{ payload.amount > 1000 }}',
trueBranch: 'fraud-check',
falseBranch: 'process-payment',
});Action nodes
Action nodes interact with external systems and services.
| Node | Description | Use case |
|---|---|---|
| HTTP | Make HTTP requests to any API | Call external services |
| Code | Run custom JavaScript/TypeScript | Complex transformations |
| Log | Write to the workflow execution log | Debugging, audit trail |
Example: HTTP action
workflow.addNode({
type: 'http',
method: 'POST',
url: 'https://api.fulfillment.com/orders',
body: '{{ payload }}',
headers: { Authorization: 'Bearer {{ secrets.FULFILLMENT_KEY }}' },
});AI nodes
AI nodes bring intelligence into workflows as first-class citizens.
| Node | Description | Use case |
|---|---|---|
| Agent | Autonomous AI agent with tool access | Complex reasoning tasks |
| Classify | Categorize input into predefined labels | Intent detection, routing |
| Generate | Produce text, summaries, or responses | Content creation, replies |
| Extract | Pull structured data from unstructured input | Entity extraction, parsing |
Example: classify node
workflow.addNode({
type: 'classify',
labels: ['support', 'sales', 'billing', 'urgent'],
input: '{{ payload.message }}',
outputField: 'category',
});Example: agent node
workflow.addNode({
type: 'agent',
model: 'claude-sonnet-4-20250514',
systemPrompt: 'You are a customer support agent...',
tools: ['lookup-order', 'check-inventory', 'create-ticket'],
input: '{{ payload }}',
});Primitive nodes
Low-level nodes for direct data operations within your npayload instance.
| Node | Description | Use case |
|---|---|---|
| Query | Read data from your instance database | Lookup, enrichment |
| Mutation | Write data to your instance database | State updates |
| Publish | Publish a message to a channel | Event chaining |
| Subscribe | Create or update a subscription | Dynamic routing |
| Batch | Execute multiple operations atomically | Transactional updates |
Next steps
- Connectors for external service integration
- Building workflows to compose nodes into workflows
- AI pipelines for AI-powered processing patterns
Was this page helpful?