Creating Your First Flow
This guide walks you through creating your first automation flow in TinySystems. You'll build a simple HTTP webhook that processes incoming requests and returns a response.
Prerequisites
Before starting, ensure you have:
- A TinySystems account
- Access to a workspace
- At least one connected cluster (or use the demo cluster)
Step 1: Create a New Project
- Navigate to your workspace dashboard
- Click New Project
- Enter a name (e.g., "My First Project")
- Select the target cluster
- Click Create
Step 2: Create a New Flow
- Inside your project, click New Flow
- Enter a name: "Hello World API"
- Click Create
The flow editor opens with an empty canvas.
Step 3: Add an HTTP Server Node
The HTTP Server component receives incoming HTTP requests.
- Open the node palette (left sidebar)
- Find HTTP Module > Server
- Drag it onto the canvas
- Click the node to select it
Configure the Server
In the properties panel (right sidebar):
- Click the Settings port (top of node)
- Configure:
- Listen Address:
:8080 - Read Timeout:
30s - Write Timeout:
30s
- Listen Address:
Step 4: Add a Response
The HTTP Server has multiple output ports. We'll connect to the request port to handle incoming requests.
- Find the request output port (right side of Server node)
- This port emits data when requests arrive
For this example, we'll send a static response. The Server's request port data flows to whatever we connect to it.
Add a Modify Node
- From the palette, drag Common Module > Modify onto the canvas
- Position it to the right of the HTTP Server
Connect the Nodes
- Click the request port on the HTTP Server
- Drag to the input port on the Modify node
- Release to create an edge
Configure the Edge
Click on the edge (connection line) to configure data mapping:
# Map the incoming request to our response format
body: '{"message": "Hello, World!", "timestamp": "{{now()}}"}'
contentType: "application/json"
statusCode: 200Step 5: Complete the Response
- Connect the Modify node's output port
- Drag to the HTTP Server's response port
This creates a loop: request comes in, gets modified, and goes back as a response.
Step 6: Deploy the Flow
- Click Deploy in the top toolbar
- Wait for deployment to complete (green status indicator)
Step 7: Test Your Flow
Get the Endpoint URL
- Click the HTTP Server node
- In the properties panel, find the Endpoint URL
- Copy the URL
Send a Test Request
Using curl:
curl https://your-endpoint-url.tinysystems.io/Expected response:
{
"message": "Hello, World!",
"timestamp": "2024-01-15T10:30:00Z"
}Understanding What Happened
HTTP Request
│
▼
┌──────────────┐
│ HTTP Server │ ─── Receives request on port 8080
└──────────────┘
│ request port
▼
┌──────────────┐
│ Modify │ ─── Transforms data into response format
└──────────────┘
│ output port
▼
┌──────────────┐
│ HTTP Server │ ─── Sends response back to client
│ (response) │
└──────────────┘- HTTP Server listens for incoming requests
- When a request arrives, it emits data from the
requestport - Modify transforms the data according to the edge configuration
- The response flows back to the Server's
responseport - HTTP Server sends the response to the client
Adding Dynamic Content
Let's enhance the flow to include request information:
Update the Edge Configuration
Click the edge between Modify and HTTP Server response:
body: |
{
"message": "Hello from TinySystems!",
"method": "{{$.method}}",
"path": "{{$.path}}",
"clientIP": "{{$.realIP}}",
"timestamp": "{{now()}}"
}
contentType: "application/json"
statusCode: 200Now the response includes details from the incoming request.
Adding Error Handling
Create an Error Response
- Add another Modify node for error cases
- Configure it for error responses:
body: '{"error": "Something went wrong"}'
contentType: "application/json"
statusCode: 500Use a Router for Conditional Logic
- Add a Router node between the Server and Modify
- Configure routes:
- Route 1:
{{$.path == "/health"}}→ Health check response - Default: Regular response
- Route 1:
Next Steps
- Understanding the Editor - Learn the editor interface
- Running and Debugging - Debug your flows
- Flow Basics - Deeper dive into flows
- Data Mapping - Master data transformation
Quick Tips
- Save Often: Flows auto-save, but you can manually save with
Ctrl+S - Use Debug Nodes: Add Debug components to inspect data at any point
- Check Logs: View execution logs in the bottom panel
- Zoom: Use scroll wheel to zoom, drag to pan the canvas