Strucsta LogoStrucsta/Documentation

Chapter 1: Getting Started

Workflows & Steps

Target Audience: New users trying to understand the mental model of the platform.

To build effectively in Strucsta, it helps to understand how the platform organizes and executes your document generation logic. At its core, Strucsta is a visual interface for constructing a Directed Acyclic Graph (DAG)—a one-way pipeline where data enters, transforms, and exits as a PDF.

The architecture is built on a strict, simple hierarchy: Users own Workflows, and Workflows contain Steps and Connections.

The Workflow

A Workflow is the overarching container for your entire document pipeline. Think of it as a single, specialized factory line (e.g., "Monthly SEO Report Generator" or "Client Onboarding Contract").

  • Ownership: Your user account owns the workflows you create.
  • State: A workflow holds the configuration for your pipeline, as well as the historical Run records (the audit trail of every time the workflow has been executed).

⚠️ Important Note: Deleting a workflow is a destructive action. Deleting a workflow cascades and permanently deletes all associated steps, connections, and historical run data. This cannot be undone.

Steps (The Nodes)

If the workflow is the factory building, the Steps are the specialized machines inside. Each step performs a single, specific task in the data transformation process.

Steps are categorized into three main phases:

1. Ingest Steps (Sources)

These steps are responsible for catching or collecting data from the outside world.

  • Auto-Generated Forms: User-facing UIs hosted by Strucsta to collect manual input.
  • Webhooks: Endpoints to catch automated payloads from CRMs, Zapier, or your own backend.
  • APIs: Direct integrations to pull structured data into the pipeline.

2. Reason Steps (Transformations)

This is where the AI processing happens.

  • LLM Nodes: These steps utilize OpenAI models to analyze the incoming data. Crucially, these steps use zodResponseFormat to enforce strict structured outputs. This means you aren't just getting raw text back from the AI; you are getting validated, predictable JSON that your template can rely on.

3. Render Steps (Sinks/Generators)

These steps take the structured JSON and turn it into your final asset.

  • PdfMaker: The core rendering engine. This step takes your JSONC (JSON with comments) layout template, applies Handlebars logic, processes recursive includes, and generates the final pixel-perfect PDF document.
  • Delivery (Sinks): Steps like EmailSink that take the generated PDF and deliver it to the end user or route it to a storage bucket.

Connections (The Edges)

Connections define the flow of data between your Steps. They dictate the one-way path from raw input $\to$ structured logic $\to$ final visual layout.

Because Strucsta is designed specifically for short, highly focused document generation workflows, data passed through connections is merged flatly. This means that downstream steps (like your Render step) have cumulative access to both the original input data and the AI-generated reasoning data, making template variable injection straightforward and reliable.