Crystallization
Turn ad-hoc AI work into deterministic, repeatable automations
Crystallization
Crystallization converts successful agent runs or chat threads into deterministic automation DAGs. What starts as exploratory AI work becomes a reliable, repeatable pipeline.
The Problem
AI chat is powerful but ephemeral. If an agent successfully builds a report by running five tools in sequence — querying data, transforming results, building a flashboard — you want to capture that workflow and run it again tomorrow without AI interpretation overhead.
| Approach | Trade-off |
|---|---|
| Re-run the same chat prompt | Non-deterministic; AI may choose different tools or parameters |
| Manually build an automation | Time-consuming; error-prone to reconstruct from memory |
| Crystallize the run | Deterministic; captures exact steps, parameters, and order |
How It Works
Two Sources
Crystallization works from two sources:
| Source | Endpoint | When to Use |
|---|---|---|
| Agent runs | POST /api/v1/agents/runs/{run_id}/crystallize | After a successful agent execution |
| Chat threads | POST /api/v1/chat/threads/{thread_id}/crystallize | After a chat conversation with completed actions |
What Gets Captured
The crystallization process extracts every tool call from the run and converts it into an automation step:
| Source | Captured As | Result |
|---|---|---|
| Tool calls | DAG steps | Each tool call becomes an automation step with its action kind |
| Parameters | Step inputs | Resolved values are frozen as step configuration |
| Execution order | Dependencies | Steps maintain the same execution sequence |
| Approval gates | approval_gate steps | Human oversight is preserved where needed |
Example
An agent run that:
- Called
generate_queryto get revenue data - Called
generate_queryto get order counts - Called
create_flashboardto build a dashboard
Becomes an automation with three steps in sequence, each with the exact parameters used during the original run.
Non-deterministic steps (like generate_query where the SQL is AI-generated) are flagged in the automation metadata. You can review and edit the frozen parameters before activating the automation.
Crystallized Automations
The output is a standard automation with source_type=CRYSTALLIZED. It has all the capabilities of any other automation:
| Feature | Available |
|---|---|
| Triggers (schedule, webhook, event) | Yes |
| Monitoring and run history | Yes |
| Versioning | Yes |
| Editing steps | Yes |
| Adding/removing steps | Yes |
| Conditional branching | Yes |
The only difference is the source_type field, which records where the automation originated:
| Source Type | Origin |
|---|---|
MANUAL | Created directly via API or UI |
CRYSTALLIZED | Extracted from an agent run or chat thread |
Crystallized automations are fully editable. You can modify steps, add triggers, adjust conditions, or extend the workflow after creation.
When to Crystallize
| Scenario | Recommendation |
|---|---|
| Successful multi-step workflow you'll repeat | Crystallize |
| Stable data pipeline (extract, transform, visualize) | Crystallize |
| One-off exploratory analysis | Skip |
| Workflow still being iterated on | Wait until stable |
| Simple single-tool operation | Likely overkill |