Overview
Riffle converts Tray.io workflows into Python files and back again. Each workflow becomes a single .py file that you can read, edit, and version-control alongside your code.
A typical workflow file looks like this:
"""Workflow: Process Webhook"""
from riffle.sdk import Field, Schema, connectors, workflow
class WebhookInput(Schema): name: str age: int active: bool
@workflow(title="Process Webhook", input_schema=WebhookInput)def process_webhook(trigger: connectors.callable_trigger.trigger): update_record = connectors.salesforce.update_record( object_id=trigger.record_id, )The file has three parts:
- Schema classes define the shape of input and output data using Python type annotations and an optional
Field()descriptor. - The
@workflowdecorator declares metadata like the title, tags, and which schemas to use. - The function body wires connector steps together, referencing outputs from previous steps as Python attribute access.
All imports come from riffle.sdk. The SDK provides Schema, Field, connectors, and workflow.
Round-trip fidelity
Section titled “Round-trip fidelity”Riffle’s codec is bidirectional. riffle pull converts a Tray.io workflow JSON into Python. riffle push converts the Python back to JSON. The goal is round-trip fidelity — pulling then pushing should produce the same workflow, so you can safely edit the Python without losing platform configuration.