π Workflow Concepts
TuringDB lets you build powerful analytical and agentic workflows using our Python SDK or directly in TuringDB Cloud. These workflows combine data processing, AI model orchestration, and graph-native storage in a seamless, visual pipeline that integrates with TuringDBβs graph engine. Use them to:- Analyze files with AI and enrich your graphs
- Build LLM-based memory on top of your data
- Orchestrate custom pipelines with branching logic, REST APIs, and more
π§ LangGraph Wrapper for Workflows
We use LangGraph as the core execution engine to manage:- Flow of data between tasks (nodes)
- Execution scheduling
- Edge connections between operations
π§ Why We Built a Wrapper
Our wrapper around LangGraph enables:-
Declarative JSON execution
- Define a list of nodes and their edges
- Specify parameters like API keys, prompts, and output fields
- The engine will infer the execution flow and run the correct Python functions behind the scenes
-
Expression-based JSON referencing
- We treat LangGraph as a data propagation engine
- All data flows in a shared, structured JSON object
- You can reference any part of that JSON using flexible expressions (
$data.field
,$array[i]
, etc.) - This makes the system modular, extensible, and easy to integrate with APIs or databases
π§± Workflow Structure
A workflow is a graph of nodes connected by edges where data flows from one node to another.π§© Core Components
- Nodes: Units of execution (e.g., extract text, call an LLM, fetch stock data)
- Edges: Define the order of execution and pass data between nodes
- Execution Engine: Schedules and runs nodes in the correct order
- Data JSON: A shared object where all intermediate data is stored
π§Ύ Example Use Case: Document Analysis
- Load a PDF from S3
- Extract the text content
- Use LLM to list company tickers
- Loop through each ticker and fetch financial data
- Format and output the results
π§ Workflow JSON (example)
π Node Concepts
A Node is a building block of your workflow that performs a single task.𧬠Node Anatomy
node_type
: What it does (e.g.,LLM
,ExtractTextPDF
,SendEmail
)params
: Key parameters, API keys, fields, configsinput_field
: Where to read input data from the workflow JSONoutput_field
: Where to write output data in the workflow JSON
π‘ Example: Email Node
π Common Node Types
Node Type | Purpose |
---|---|
S3LoadFile | Load a file from cloud storage |
ExtractTextPDF | Extract content from PDF files |
LLM | Query OpenAI, Anthropic, or Mistral |
RestAPI | Fetch data from external APIs |
SendEmail | Send email notifications |
GeneratePDF | Create PDFs from text |
OutputText | Standardise outputs from workflows |
β¦ see more in detailed node documentation |
π Edge Concepts
Edges connect nodes and define the flow of data and order of operations.π Data Flow
- Node A completes β stores its result in a field
- Node B reads from that field using
input_field
- This forms a chain of transformations
π Execution Order
- A node cannot run until all its input nodes complete
- Edges determine dependencies
- The workflow engine schedules nodes accordingly
β Edge Input Rules
Node Type | Input Type | Notes |
---|---|---|
LLM | Single Input | Operates on one data source |
SendEmail | Single Input | Sends one message at a time |
Merge | Multiple Inputs | Combines many branches |
InputText | Zero Input | Starts the flow with hardcoded or user-supplied data |
RestAPI | Zero Input | Pulls data independently |