The first RAG pilot is usually a notebook: read some files, split them, embed them, push them into a vector store. It works, and then someone asks for the same thing for a second source, on a schedule, with incremental loads, alerts when it fails, and an audit of what was loaded when. The notebook becomes a pipeline, and every source becomes another pipeline.
InsightRAG takes a different route. An ingestion job is a workflow: a small graph of typed tasks plus their settings. The platform generates the Airflow code from it, so adding a source is a matter of describing it, not writing it.
The four files a workflow becomes
When a workflow is generated, InsightRAG reads its nodes and their parent links, puts the tasks into dependency order (a topological sort, so a task never runs before the ones it depends on), and writes:
config.yaml: the workflow's name, cluster profile, data group, and the list of tasks with their type, parents and properties.properties.yaml: the run-level settings shared by every task: geography and domain, dataset, load type (history or incremental), the catalog and data group the content belongs to, business fields such as line of business, product, category and subcategory, the redaction setting, the extractor, and the engine.- one YAML per task where a task needs more than a few properties, such as the SQL for a database extract.
- the DAG itself: a short Python file that names each task, asks the shared workflow framework to build it by type, and wires the dependencies. It also sets ownership tags, an SLA in minutes, and failure and SLA-miss callbacks.
Here is the shape of a generated config.yaml, for a made-up insurer loading policy binders incrementally:
# config.yaml (generated) - example workflow for a made-up insurer
name: "na-policy-incr-binders-load"
cluster_profile: "small"
data_group: "policy_ns"
properties_file: "properties.yaml"
tasks:
- name: "start"
type: "START"
- name: "docs_extract"
type: "DB"
parents: ["start"]
properties_file: "docs_extract.yaml"
- name: "process_docs"
type: "DOC"
parents: ["docs_extract"]
properties:
extractor_profile: "simple"
- name: "vector_load"
type: "VECTOR_LOAD"
parents: ["process_docs"]
properties:
vector_index: "policy"
vector_connection: "search-connection"
embedding: "huggingface"
- name: "end"
type: "END"
parents: ["vector_load"]A generated workflow: extract from a database, process the documents, load the chunks into a vector index. Names are fictional.
And the task file for the extract step, which pulls one PDF per row out of a BLOB column and names each file after the policy:
# docs_extract.yaml - pull one PDF per policy row from a BLOB column
query: |-
SELECT POLICY_ID, INSURED, BROKER, BINDER_DOC
FROM policy_admin.binder_info
src_connection: "policy-admin-dev"
extraction_type: "DOC"
blob_column: "BINDER_DOC"
blob_column_type: "pdf"
blob_file_name: "policy-${POLICY_ID}-binder.pdf"
primary_id_col: "POLICY_ID"
Task types
The workflow framework builds each task from its type. The ones that matter for RAG are:
| Type | What it does |
|---|---|
DB | Runs a query against a registered source connection; for documents, writes each BLOB out as a file and records a document id and metadata for it. |
KB | Pulls content from a knowledge source: a database, S3, SharePoint, OneDrive, Outlook, Confluence, Jira or Teams, or converts CSV or database rows to text. |
DOC | Extracts and chunks the staged documents using the workflow's extraction profile. |
DOC_SUMMARY | Produces document summaries. |
VECTOR_LOAD | Embeds the chunks with the chosen embedding model and writes them to the named vector index over the named connection. |
START / END | Bracket the run; END cleans up and writes a done file, so downstream jobs know the load finished. |
General data tasks (S3 copies, scripts, Spark SQL, data-quality checks, Hive, BigQuery and others) are available in the same framework, so a RAG load can sit inside a wider data workflow rather than beside it.
Engines: Glue, EMR or Ray
Extraction and embedding are the expensive steps. The DOC, KB and vector-load tasks hand their work to an engine,
picked from the workflow's properties (or overridden on a task):
- AWS Glue, the default in the shipped workflows, for serverless runs without a cluster to manage;
- EMR, where the task creates a cluster from the workflow's cluster profile and runs the job on it;
- Ray, for Python-heavy document processing that benefits from fine-grained parallelism.
Each run stages its files under a path that includes the run timestamp, so a failed run can be inspected and re-run without touching the previous one.
History and incremental loads
Published workflows are organised by geography, domain and load type: for example na/policy/history/documents/… for the
one-off backfill and na/policy/incremental/documents/… for the regular top-up. Keeping the two as separate workflows means the
backfill can run on a bigger cluster profile once, and the incremental one can run small and often, with the same extraction and loading
settings.
Putting it together
- Register the source connection and the vector connection once.
- Create the workflow: tasks, parents, properties. Choose the extraction profile, the vector index, the embedding model and the engine.
- Generate the files and review them: the YAML is plain text and the DAG is a few dozen lines.
- Publish them to the workflow bucket, where Airflow picks the DAG up.
- Trigger the history load once; trigger the incremental workflow on the cadence you choose.
What happens inside the DOC task is the subject of the next article:
Extraction and chunking: what happens to a PDF.
Running and watching a DAG
The generated DAG has no schedule of its own and allows one active run at a time, so a run starts when it is triggered and a second trigger waits rather than overlapping the first. Each task is retried twice before the run is marked failed, and the failure callback then fires. The API can list the DAGs in Airflow, trigger a run, and list a DAG's runs and their state, so the same place that defines a workflow can start it and show how it went.
Questions people ask
How is the incremental load scheduled?
Through whatever starts the DAG: a trigger from the API, from Airflow, or from the scheduler your team already uses. Because the DAG itself carries no schedule, the cadence is decided outside it, and a slow run is never overlapped by the next one.
Can I edit the generated DAG by hand?
It is plain Python, so you can, but the workflow is the source of truth. Generating again writes the files from the workflow, so a hand edit would be lost. Change the workflow and regenerate.
Can each workflow have its own SLA and alert recipients?
Not yet. In the current generator the SLA, the tags and the alert addresses are the same for every generated DAG and are set for the deployment. Per-workflow values are not built.