Assemblies Overview
Assemblies are visual workflow builders that let you design complex API orchestration without writing code. Chain authentication, rate limiting, transformations, caching, and more in a drag-and-drop interface.
What are Assemblies?
An Assembly is a directed graph of policy nodes that execute on API requests. Think of it as a visual programming language for API traffic control.
┌─────────┐ ┌─────────────┐ ┌───────────┐ ┌─────────┐
│ Auth │───▶│ Rate Limit │───▶│ Transform │───▶│ Invoke │
└─────────┘ └─────────────┘ └───────────┘ └─────────┘
Key Features
- Visual Editor - Drag-and-drop workflow builder
- 21+ Policy Types - Auth, rate limit, transform, cache, validate, and more
- Real-time Testing - Test workflows instantly with built-in API tester
- Execution Logs - Track every node execution with detailed traces
- YAML Import/Export - Git-friendly workflow definitions
- Hot Reload - Changes apply instantly without restarts
Assembly Types
| Type | Description | Use Case |
|---|---|---|
| Preflow | Executes before backend call | Authentication, validation, rate limiting |
| Postflow | Executes after backend response | Response transformation, caching, logging |
| Error | Executes on errors | Error handling, fallbacks, notifications |
| Standalone | Independent workflow | Scheduled tasks, webhooks |
Assembly Scopes
| Scope | Description |
|---|---|
| Global | Organization-level (enforced on all requests) |
| Project | Project-level policies |
| Gateway | Gateway-level policies |
| Route | Route-specific policies |
Quick Example
Here's a simple preflow assembly that authenticates requests and applies rate limiting:
apiVersion: tunnelapi.in/v1
kind: Assembly
metadata:
name: API Security Flow
spec:
type: preflow
entryNodeId: auth-node
nodes:
- id: auth-node
type: auth
name: JWT Authentication
config:
type: jwt
jwt:
secret: ${env.JWT_SECRET}
- id: rate-limit-node
type: rate-limit
name: Rate Limiter
config:
windowMs: 60000
maxRequests: 100
edges:
- source: auth-node
target: rate-limit-node
Next Steps
- Policy Types - Learn about all 21+ policy types
- Creating Assemblies - Step-by-step guide
- Visual Editor - Using the drag-and-drop builder
- Examples - Real-world workflow examples