Skip to main content

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

  1. Create a Payload for a Node (Action/Flow).
  2. Refine the Node until the output is acceptable.
  3. Keep the Payload as a regression check when you iterate.
tip: Name by intent — Prefer names like minimal, typical_customer, edge_empty_messages over test1, 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

Required vs. optional

Required fields:
  • Must be present in every payload
  • Execution fails if missing
  • No default value
Optional fields:
  • Can be omitted
  • Can have default values
  • Execution continues without them
Example:

Creating payloads

In the UI

  1. Select your Project/Flow/Agent
  2. Go to Properties → Execute
  3. Enter payload in the JSON editor
  4. Click Execute
Tips:
  • Use the schema viewer to see expected fields
  • Auto-complete helps with field names
  • Syntax highlighting catches errors

Via API

Programmatically

Python:
JavaScript:

Payload validation

Triform validates payloads against the schema before execution.

Common validation errors

Missing required field:
Wrong type:
Invalid enum value:
Out of range:

Saved payloads

Save frequently-used payloads for quick testing.

Saving a payload

  1. Enter payload in Execute panel
  2. Click Save Payload
  3. Name it: Test Case 1: Happy Path
  4. Click Save

Loading a saved payload

  1. Go to Execute panel
  2. Click Load Payload
  3. Select from list
  4. Click Load
  5. Optionally modify
  6. Execute

Payload library

Organize saved payloads: By category:
  • Happy path examples
  • Edge cases
  • Error scenarios
  • Performance tests
  • Regression tests
By purpose:
  • demo_payload — For demonstrations
  • test_minimal — Minimum required fields
  • test_full — All fields populated
  • test_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

Use case: Single-purpose operations (text summarization, translation)

Pattern 2: User + action + data

Use case: CRUD operations, user-specific actions

Pattern 3: Batch processing

Use case: Processing multiple items, bulk operations

Pattern 4: Configuration-heavy

Use case: Configurable behavior, user preferences

Pattern 5: Streaming/chunked

Use case: Large payloads split into chunks, streaming data

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:
Triform payload:
Transformation code:

Debugging payloads

Common issues

Problem: Execution fails with validation error
Solution: 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 simple
Step 2: Add optional fields
Step 3: Add complexity
Step 4: Test edge cases

Payload size limits

Default limits

Free tier: 1 MB per payload
Pro tier: 10 MB per payload
Enterprise: Custom limits

Handling large payloads

Option 1: Chunking Split large payloads into smaller chunks, process sequentially Option 2: Reference by URL

Next steps

Continue exploring the documentation to learn about Executions, Variables, and integrating Projects into your apps.