Skip to main content

Data movement — Flows, Streaming & Data API

Querying reads your data in place. Sometimes you need to move it: transform and load it on a schedule, ingest a live event stream, or publish a governed endpoint other systems can call. AgentData has three subsystems for that, each a separate, independently scalable service that shares the same registry and adapters.

Use caseUse this
Load & transform on a schedule; join across sources; write to a targetFlows / ETL
Ingest a continuous stream of events into a tableStreamer
Publish a query or procedure as a secure JSON endpoint for other appsData API
Ad-hoc, read-only questionsplain Querying

Each runs as its own service on its own port (Transform 8020 · Streamer 8030 · Data API 8040), so heavy data work never starves the API. They can run in the cloud or, like the connector, inside your network.

Flows (ETL transformer)​

A flow extracts from one or more sources, transforms, and loads into a target — on a schedule or on demand. Flows land data in a staging database you provide (Postgres, MySQL or SQL Server), which holds both the control tables and the target tables.

Choose a staging database​

Open Staging databases → Connect staging DB. The first list shows existing database connections and local installations available to your workspace. Choose one and select Verify writes and connect. AgentData initializes its flow control tables and verifies read, insert, update and delete permissions.

Ready · writes verified means the last database test passed. Not tested, Not ready, Connector offline and Needs local setup need attention. The row and red navigation indicator use the same health information. Use Test to refresh it; an online local connector alone does not prove that its database is writable.

For a local installation that already watches folders, configure Staging · write destination in its desktop database settings. The same installation can read folders and write to a database. A read-only database setup remains read-only until you configure the write destination locally.

To replace an existing staging connection, choose Edit → Existing database connections. The Staging name is optional: leave it blank to use the selected connection’s name. Choose a database of the same engine and Save. An unsuccessful write check leaves the existing connection unchanged. Changing a connection does not copy flows or tables from the old database.

If a local installation is offline or does not yet have a write destination, choose Save mapping. This saves your selection as Needs local setup; it does not grant write access or make the staging database ready. Open AgentData Connector → Configuration → Database → Staging · write destination on that computer, configure and test the database, then restart the worker. Back in AgentData, choose Test to initialize the flow control tables and verify writes. Automatic status checks do not initialize pending mappings.

Use Configure a new connection to choose Local connector or Regular database connector. The connector setup manages database credentials. The staging form only selects the connection.

IDE connection guide lists compatible IDEs with separate instructions for DBeaver and DataGrip. It shows available connection fields and security options; it does not automatically launch an installed IDE. For local installations, run your IDE on a computer that can reach the database and use the write-database credentials from the local connector. The AgentData token is not a database password. If the installation has not reported database metadata, read the host and database name from its local settings.

The Connectors page lists connections first, then local installations, managed databases, storage overview, and installation instructions. Its connection lists are cached during your browser session. Installation status keeps updating in the background; configuration changes refresh the lists automatically. Use the header Refresh button to request the latest inventory.

For application schema management, see Managed databases.

Building a flow​

Saved flows remain browsable when their staging connector is offline. Your current tenant, project and connector visibility settings still apply. A legacy flow whose dependencies have not yet been saved may need the connector online before it can appear; check Staging databases, reconnect, and refresh. This does not delete the flow or grant access to another tenant's flows.

Open Data Flows → Flows, choose your staging database, and select New flow or Edit.

The top navigation opens Flows, Pipelines, Schedulers, Data API & streaming, or Staging databases directly. A red staging label with an information icon means a connection needs attention; open that section to diagnose it.

The left palette groups resources into Semantic models, Relational databases, MCP & prospecting, APIs, Files, Reporting, Staging tables, and Communication. It follows your selected tenant and project. A reporting connector that only exposes metadata is shown as unavailable for data extraction.

Drag a resource onto the canvas, or click it to add a step. Each step reads a source and writes a destination. Rename it directly on the card; this changes its label in this flow, not the underlying connection. Provider marks distinguish SQL Server, Oracle, PostgreSQL and other connections from semantic resources.

  • Move cards anywhere on the canvas. Select a card to resize it using its corner handles.
  • Draw an arrow from the right dot of one card to the left dot of another. The receiving step waits for the first step to finish. Cycles are rejected.
  • Use the canvas controls to zoom or fit the whole graph. Select an arrow and press Delete to remove a dependency.
  • Open a card's Edit settings to choose its table/object, destination, matching keys and mappings. Saved queries appear inside the matching source's settings, rather than as separate palette entries.
  • For downstream data, select an earlier step's output table as the next step's staging source. An arrow sets order; the source and destination settings determine what data moves. Joining or deduplicating records also needs an explicit query/mapping and matching keys.

Use Test source to inspect sample output without loading the destination, and Verify flow to check source/target configuration. Tests may call the selected provider and consume its quota. Changes autosave as your private draft for this tenant, project, staging database and flow. Save draft adds a named, private draft to the flow list, even with incomplete nodes or no staging database. Choose Configure target later while designing. Publish flow validates and publishes the executable definition to the selected staging database. Run is a separate action; publish changes before running. Existing schedules, logs, mappings and version history remain available.

Existing row-based flows open as graphs with arrows preserving their original stage order. Steps at the same dependency depth can run in parallel; the next depth waits for that stage. Stage actions and review gates keep their original execution boundaries. If an edit splits or merges stages that have actions, saving asks you to resolve that conflict.

Build or refine a flow with chat​

Expand Build with chat above the canvas. Describe the connections, selection rules, destination and matching keys. Chat proposes a graph using the resources you can access. Review the proposed steps, then select Apply to canvas. You can refine the proposal in chat or edit the same graph manually. Apply does not save or run the flow.

For example:

Use my Apollo and Hunter connections to find up to 10 companies from each matching this industry and region. Exclude companies from Hunter that Apollo already added. Combine them in the selected staging database's companies table, matching on domain. Use one contact per company.

Specify what “best” means if you want ranking. Provider availability determines the number of results; requesting 10 does not guarantee 10. The Apollo/Hunter selection uses the existing prospecting capability and requires your configured provider credentials and tenant policy to allow it. When an exclusion table is required but cannot be read, the step stops instead of silently returning duplicates.

After answering a clarification, continue in the same conversation. AgentData retains the accepted destination and connections. A structurally invalid AI reply is automatically retried once; a persistent failure keeps your graph and prompt intact. Check the proposed company counts, destination and matching keys before Apply to canvas.

If chat reports insufficient provider credit, ask your administrator to top up the AI provider account or replace its API key. Your draft and manual graph editing remain available.

Chat replaces the Data Flow Notebook tab for creating flows. Previously saved notebooks are retained and existing notebook links remain accessible.

Workspace size and refresh​

Use Expand workspace for a movable, resizable view, or Open in new window to move the palette, canvas, settings and prompt into a separate window. The header, flow name, save controls and designer move together. Compact Refresh, Expand and Open in new window icons sit beside More. Closing the window returns your edits, chat and unsent prompt to the designer. Keep the main page open while using the separate window.

Returning to Flows reuses recently loaded data. Previously loaded published definitions and named drafts remain readable when staging is offline; refreshing and executing need the destination to be available. Refresh on the flow list reloads its databases and flows; Refresh inside the designer reloads its available resources and staging tables. Saving changes updates the relevant views. Switching tenant or project uses that scope's resources.

Semantic model sources​

Choose a saved model such as Sales or HR. Individual dimensions are not separate semantic palette sources. In the node settings, enter a Question for this model and choose Build model query, or choose a saved query associated with that model. AgentData plans against the model’s confirmed entities, dimensions, measures and relationships, validates the fields and joins, and saves the plan in the flow. For sales by customer, the sales fact supplies the measure and the customer dimension supplies the grouping. The required query engine and source connections must be available to execute it.

Exposing a flow through REST or MCP​

  1. Publish the flow. An interface is created disabled, ready for review.
  2. Open Data API & streaming → Flow interfaces and choose the flow.
  3. Set its URL name (letters, numbers and underscores), input target and output source. Enable REST, MCP or both, then save and enable the interface. The full input/output URLs and MCP endpoint appear here.
  4. Open Test input / output. Discuss input / output explains the contract and can propose example JSON records. It does not execute the flow. Use proposed input copies those records into the test form.
  5. Choose Run to execute, then Read output to inspect the selected target’s current contents. Use New request ID for a new run. Retrying the same ID and same input returns the recorded run status/result; changing the input with the same ID is rejected.

For a flow that accepts records, drag Communication → AgentData input onto the canvas, configure its destination table and map incoming fields. A source-backed flow can instead accept a trigger with no records. Add AgentData output and select an upstream table to return data. Output reads show the current table, not a permanent snapshot of a previous run.

REST flow endpoints use an authenticated AgentData user Bearer token and the selected X-Project-Id. The connector Data API tokens described below are a different credential. Your AgentData MCP connection needs the flows permission; ask it to list flow interfaces, describe the chosen contract, invoke it with a unique request ID, or read its output. Tenant, project and flow permissions still apply.

Schedulers is available in each published flow’s More menu and interface settings. An administrator can set a cron schedule for a flow reading existing sources. A flow requiring incoming records must be called with those records, rather than scheduled without them.

Slack can start a configured flow using an explicit /flow command with optional JSON rows, sent to the configured bot by a mapped workspace user. Its response returns to the originating conversation. Teams and WhatsApp flow execution are not available yet; their canvas choices remain disabled. General outbound channel destinations are not yet supported by these flow interfaces.

Streaming is in the same section. It queues incoming events into a staging table; use that table as a source and schedule a consuming flow. It is useful for continuous events and batching. REST/MCP are the direct on-demand flow triggers; a stream event does not automatically invoke a flow.

The staging database​

The staging DB is yours — on-prem or cloud, isolated per tenant by a tenant_id on every control row. AgentData either creates a new database and installs its control tables (flows, flows_scheduled, flows_exec), or uses an existing one you point it at. Target tables are namespaced so multiple tenants can safely share one staging server. The same control DDL is shipped for each engine, so the behaviour is identical across Postgres/MySQL/SQL Server.

Running, scheduling & alerts​

The transform server resolves each source, applies the transforms, and loads in chunks inside a transaction (rolling back on failure). A scheduler fires flows on a daily/weekly/monthly cadence or a cron expression, and every run is logged to flows_exec. Success/warning/error alerts go out by email and Slack.

Admins tune runtime behaviour (per-tenant, or globally) in Settings → Config → ETL runtime: max_parallel, bulk_rows (chunk size), alert_on + email/Slack, allow_create_target, allow_saas_write (live SaaS write vs. dry-run), and log_retention_days.

Pipelines (a DAG of flows)​

A pipeline wires flows into a directed graph: edges mean "run after". Flows with no pending dependencies run in parallel; a flow whose upstream failed is skipped. Build it by dragging nodes and arrows, auto-layout, then run now or on a schedule.

A pipeline DAG

Scheduling flows and pipelines

Turn a flow output into a queryable source

Register a staging DB as a source and its flow-target tables become discoverable entities — so the thing you just built with ETL is immediately queryable through the semantic layer and MCP.

Streamer (real-time events)​

The Streamer ingests a live stream of JSON events into a staging table. External systems POST events to an ingest URL; the streamer queues them on a broker and micro-batches them into an append-only target that's immediately queryable.

To use it: define a stream (name + staging DB + target table) in the app. You get an ingest path and a token (shown once). Producers POST single events or batches; the consumer flattens each event (top-level fields become columns) and appends it. Delivery is at-least-once. The broker is either internal (in-memory, single instance) or a managed cloud Redis for production — configured in Settings.

Use Streamer when data arrives continuously (webhooks, telemetry, app events) rather than on a schedule.

Configuring an event stream and its broker

Data API​

The Data API turns a connector into a governed, read-only JSON endpoint — an API-gateway/ESB layer for data-out. You define a service once; consumers call it with a bearer token and only the parameters you allow. No raw SQL is ever exposed.

A service has a kind:

  • sql — a stored SELECT on a relational source, parameters bound as :name placeholders;
  • routine — a stored procedure or SAP BAPI call;
  • api — a SaaS object fetch (e.g. HubSpot contacts).

You can shape the output with a mediation transform — filter rows, cast columns, add computed columns, and select/rename — and set concurrency, timeout, retries, a per-service rate limit, and an optional dedicated connection pool (so a heavy service can't starve another's connections). Test the service before publishing.

Tokens are hashed (never stored in plaintext), can expire, and can be rotated (a successor is minted with a grace window) or revoked. Callers may only pass the parameters you declared — never arbitrary SQL — and HTTPS is enforced in production; a per-service rate limit sheds excess load with a 429.

Beyond a simple synchronous call, a service can:

  • Page large extracts — ?offset=N&limit=M; the response meta.next_offset tells the caller when to fetch the next page, so you can pull millions of rows in bounded-memory pages.
  • Run asynchronously — ?async=1 returns a job id to poll; the call runs on a durable Postgres-backed queue (retries, dead-letter) instead of holding the request open.
  • Pull on a schedule — set a cadence (e.g. every 5 minutes) and AgentData enqueues the call automatically — a lightweight scheduled sync.

Every call is audited; the Data API monitor shows queue depth, per-service call counts, error rates and p95 latency, and recent calls (see Monitoring).

Defining a Data API service and minting tokens

Choosing between them​

  • Flows — scheduled/batch transform and load, cross-source joins, write-back, orchestrated pipelines.
  • Streamer — the moment data arrives continuously and you want it landed and queryable in near-real-time.
  • Data API — you want other systems to pull governed data out, with tokens, expiry and per-parameter control.
  • Querying — a human or agent just needs an answer, read-only, right now.

They compose: a Streamer lands events → a Flow enriches and joins them → the result is exposed via the Data API and queried through MCP.

Next steps​

  • Adapters — the sources and targets flows connect to
  • Monitoring — watch flows, streams and Data API health
  • Administration — staging DBs, ETL runtime settings, and who can do what

Typed Flow requests and saved run output​

In Data API, select a Flow and open Input field types. Define every mapped field, choose its type and set required/null rules, then Save. Exact decimals use JSON strings; dates use YYYY-MM-DD, and instants must include a timezone. Requests are validated before the Flow starts. Older interfaces keep their existing mapping-based checks until you configure explicit types.

Under Test input / output, keep Read saved output for this request ID selected to view the selected node’s retained result from that run. The API equivalent is GET /api/flows/interfaces/<slug>/output?request_id=<request_id>. The user MCP tool read_flow_output accepts the same optional request_id. Omitting it reads the current selected target. Saved results stay stable after later upserts or a different output-node selection, subject to current access permissions. They can be read without reloading the staging database.

Saved output is bounded by configured row and byte limits. Check complete, truncated, retained_rows and has_more before treating a response as the full result. A capped output-reader reports when its total count is only a lower bound. Large Flow writes continue beyond the retained preview limit. Reusing a request ID with the same input returns the prior result; different input requires a new ID. A failed or paused run does not expose a successful result snapshot.