What is a Payload?
A Payload is the input data you provide when executing a Project, Flow, Agent, or Action. It’s a JSON object that contains all the information needed for that execution. Think of it as:- The arguments to a function
- The request body of an API call
- The input to your system
Why Payloads
- Speed — One‑click reruns for common cases.
- Reproducibility — Lock in known‑good inputs as your baseline.
- Documentation — Show how a component is intended to be used.
Good Payloads include
- Minimal required fields with realistic values.
- Edge‑case variants (empty, large, malformed types).
- Comments or README references for context.
Workflow
- Create a Payload for a Node (Action/Flow).
- Refine the Node until the output is acceptable.
- Keep the Payload as a regression check when you iterate.
tip: Name by intent — Prefer names likeminimal
,typical_customer
,edge_empty_messages
overtest1
,test2
.
Payload structure
Basic payload
Nested payload
Payload with metadata
Payload schema
The schema defines what fields are expected, their types, and validation rules.Defining a schema
In your Project/Flow Input node:Data types
Type | Example | Description |
---|---|---|
string | "hello" | Text |
number | 42 , 3.14 | Integer or float |
boolean | true , false | True/false |
array | [1, 2, 3] | List of items |
object | {"key": "value"} | Nested structure |
enum | "red" from ["red", "green", "blue"] | Fixed options |
null | null | Absence of value |
Required vs. optional
Required fields:- Must be present in every payload
- Execution fails if missing
- No default value
- Can be omitted
- Can have default values
- Execution continues without them
Creating payloads
In the UI
- Select your Project/Flow/Agent
- Go to Properties → Execute
- Enter payload in the JSON editor
- Click Execute
- Use the schema viewer to see expected fields
- Auto-complete helps with field names
- Syntax highlighting catches errors
Via API
Programmatically
Python:Payload validation
Triform validates payloads against the schema before execution.Common validation errors
Missing required field:Saved payloads
Save frequently-used payloads for quick testing.Saving a payload
- Enter payload in Execute panel
- Click Save Payload
- Name it:
Test Case 1: Happy Path
- Click Save
Loading a saved payload
- Go to Execute panel
- Click Load Payload
- Select from list
- Click Load
- Optionally modify
- Execute
Payload library
Organize saved payloads: By category:- Happy path examples
- Edge cases
- Error scenarios
- Performance tests
- Regression tests
demo_payload
— For demonstrationstest_minimal
— Minimum required fieldstest_full
— All fields populatedtest_edge_empty_list
— Edge case testing
Payload best practices
Provide examples — Include sample payloads in documentation
Use meaningful values —"user_123"
is better than"test"
Test edge cases — Empty arrays, null values, max sizes
Save regression tests — Keep payloads that found bugs
Document schema — Clear descriptions for each field
Version payloads — If schema changes, update saved payloads
Payload patterns
Pattern 1: Simple request
Pattern 2: User + action + data
Pattern 3: Batch processing
Pattern 4: Configuration-heavy
Pattern 5: Streaming/chunked
Dynamic payloads
Generate payloads programmatically.From user input
From database
From webhook
Payload transformation
Sometimes you need to transform external data into Triform payload format.Example transformation
External API response:Debugging payloads
Common issues
Problem: Execution fails with validation errorSolution: Check payload against schema, fix type mismatches or missing fields Problem: Payload is valid but execution fails
Solution: Check execution logs, data might be valid format but wrong content Problem: Payload too large
Solution: Check quotas, consider chunking or reducing data size Problem: Payload works in UI but not via API
Solution: Check JSON encoding, content-type header, authentication
Testing payloads
Step 1: Start simplePayload size limits
Default limits
Free tier: 1 MB per payloadPro tier: 10 MB per payload
Enterprise: Custom limits