Getting Started — Connecting your Data

Get from zero to a working data product in under ten minutes. Loxtep offers four ways to get started — pick the one that matches how you work:

PathBest forWhat you need
Agent-first (MCP)Conversational operation through your AI coding toolAny MCP-compatible client (Cursor, Kiro, Claude, etc.)
Code-first (CLI)Authoring workflows as code, local testing, CI/CD deployNode.js 22+, @loxtep/sdk installed
Programmatic (SDK)Writing/reading events from application codeNode.js 22+, @loxtep/sdk installed
Web UIVisual project setup and managementA browser

All four paths produce the same outcome: a project with a connected data source, a deployed data product, and queryable data. You can mix and match — start in the UI, operate with your agent, deploy from CI.

Prerequisites

Before you begin, ensure you have:

  • A Loxtep account (sign up at loxtep.io).
  • A data source to connect (a database, API, or sample CSV).
  • For Agent/CLI/SDK paths: Node.js 22+ installed.
  • For Agent path: Loxtep MCP already set up (see Quickstart).

Agent-first (MCP)

The fastest path if you already have MCP connected. Drive everything conversationally.

1. Create a project

Tell your agent to scaffold a new project:

Create a new Loxtep project called "commerce-mesh".

The agent will:

  • Call the loxtep_workspace MCP tool
  • Set up the project structure
  • Report back with your project ID

2. Discover available connectors

Find out what data sources Loxtep can connect to:

What types of connectors does Loxtep support? Show me the full list.

The agent queries the MCP tool surface and lists connectors like PostgreSQL, MySQL, Shopify, Stripe, Segment, S3, and more.

3. Connect your data source

Connect your source with the appropriate credentials. For example, PostgreSQL:

Connect a PostgreSQL database at db.example.com, port 5432, database "commerce",
user "readonly_user", password "your-password".

Or Shopify:

Connect my Shopify store at https://mystore.myshopify.com with API key "shppa_..."
and access token "shpat_...".

The agent will:

  • Call the loxtep_connect MCP tool to create a connector
  • Ask clarifying questions if needed (which database, schema, etc.)
  • Report back with the connector ID

4. Add the connector to your project

Wire the connector into your project as a named connection:

Add that connector to my commerce-mesh project as a connection called "commerce-db".
Test the commerce-db connection — is it working?

The agent:

  • Creates the connection
  • Tests connectivity
  • Reports success or troubleshoots issues

5. Define a data product

Define a source data product with a typed schema:

Create a source data product called "orders" in commerce-mesh with fields:
order_id (string), customer_id (string), total_amount (number, in cents),
and created_at (datetime).

The agent:

  • Calls loxtep_build to create the product
  • Registers the schema
  • Confirms the product is ready

6. Build a workflow

Create an ingestion workflow that pulls data from your source into the data product:

Create a workflow called "ingest-orders" that:
1. Reads orders from the commerce-db connection
2. Transforms them into the orders data product schema
3. Writes them to the orders data product
Then deploy it to my sandbox instance.

The agent:

  • Builds the workflow graph
  • Deploys it to your runtime instance
  • Confirms deployment status

7. Query your data

Run an analytical query to verify data is flowing:

How many orders do I have since January 2024, and what's the total revenue?

The agent:

  • Calls loxtep_query to execute SQL
  • Returns results
  • Verifies your pipeline is working

Done. Your agent handled all the MCP tool calls behind the scenes.


Code-first (CLI)

The code-first path is for developers who want to author workflows as TypeScript modules, test locally with sample events, and deploy through CI. Five commands take you from empty directory to production.

1. Install the SDK

Install the Loxtep SDK package from npm:

npm install @loxtep/sdk

2. Log in

Authenticate your local CLI session with the Loxtep API:

npx loxtep login

A browser window opens — sign in to Loxtep and you're authenticated. Tokens are saved locally and refresh automatically.

CI/headless: Use npx loxtep login --email you@co.com --password … or set LOXTEP_AUTH_TOKEN in your environment.

3. Initialize a project

Scaffold a project from a template to get the full directory structure and typed config:

npx loxtep init --template shopify-orders

The command outputs the scaffolded file tree:

✓ Scaffolded .loxtep/project.json
✓ Created domains/ connectors/ workflows/ data-products/
✓ Wrote AGENTS.md and .loxtep/skills/shopify-orders.yaml

Next: loxtep attach   ·   Getting Started → docs.loxtep.io/start

This scaffolds the full project structure from a template — config, directory tree, an AGENTS.md for your coding agent, and a default skill scoped to the template's resources.

Without a template, initialize a bare project:

npx loxtep init

4. Attach to an instance

Bind the project to a managed runtime instance for deployment:

npx loxtep attach --instance prod

The CLI confirms the binding:

✓ Linked project to managed instance lx_prod_8f3a
✓ Wrote instance_id + api_url to .loxtep/project.json

This connects the project to a shared, managed, or self-hosted instance and records the binding in your project config.

5. Generate typed workspace constants

Codegen typed constants from your live data products, connectors, and queues:

npx loxtep generate

The generator reports what it found:

Generating typed workspace context…
  data products  12
  connectors      5
  domains         3
  queues          8
✓ Wrote .loxtep/generated/index.ts

Projects your live data products, connectors, domains, and queues into typed constants your code and agent can reference by name.

6. Author a workflow

Create a workflow module that references your typed workspace:

// workflows/orders-enricher.ts
import { defineDataWorkflow, on } from '@loxtep/sdk';
import { workspace } from '../.loxtep/generated';

export default defineDataWorkflow({
  name: 'orders-enricher',
  triggers: [on.queueEvent(workspace.queues.orders_raw)],
  async handler(ctx, event) {
    await ctx.toolbox.dataProducts.upsert({
      dataProduct: workspace.dataProducts.orders_enriched,
      domain: workspace.domains.commerce,
      record: event,
    });
  },
});

7. Test locally

Run your workflow handler locally with a sample event file:

npx loxtep test orders-enricher --event ./events/order-created.json

The test runner outputs a full action trace:

▶ Running orders-enricher locally

─── Action Trace ───────────────────────────────────
  ✓ [1] handler.start → orders-enricher [succeeded]
  ✓ [2] dataProducts.write → orders_enriched [succeeded]
  ✓ [3] handler.complete → orders-enricher [succeeded]
────────────────────────────────────────────────────

✓ 1 event processed, 0 errors

Executes your handler locally with a sample event and prints the full action trace. Operations listed in requireApproval prompt for confirmation before executing. That prompt runs only during loxtep test. It does not add a step to the deployed flow, and the handler itself does not run on the platform.

To pause a deployed flow for a person, add an approval after an existing step. In Studio, choose Approval on the insert menu. The step is named Approval, uses the channel inbox, and waits 24 hours. The step that followed moves onto the approved path. A rejected path stays unset until you add it. An approval cannot be the first step. Decide the waiting event in Inbox.

From a project that is already attached:

loxtep approval add \
  --workflow <workflow-id> \
  --after <entity-id> \
  --name "Order review" \
  --channel inbox \
  --timeout-hours 24

--after is the id of the step the approval follows. In a workflow bundle the same step is approvals/{approval_node_id}.json, with name, approval_channel, timeout_hours from 1 to 168, workflow_id, and upstream_entity_id. The next step points upstream_entity_id at the approval, sets upstream_entity_type to approvals, and sets upstream_label to approved.

8. Deploy

Push all compiled modules to the workflow engine:

npx loxtep deploy

The deploy process validates and ships your workflows:

Compiling 3 modules…             ✓
Validating referenced resources… ✓
Updating orders-enricher (in place)  ✓
Creating refund-watcher              ✓
✓ Deploy queued · track: loxtep activity list

Compiles every module, checks that referenced resources exist, then creates or updates the workflow on the attached instance. A module that declares an approval node writes that node onto the flow. The handler is not uploaded.

Summary: the five-command lifecycle

The complete CLI workflow uses these five commands in sequence:

loxtep init --template <slug>   # Scaffold project from template
loxtep attach --instance <name> # Bind to a runtime instance
loxtep generate                 # Codegen typed workspace constants
loxtep test <module> --event …  # Run locally with sample events
loxtep deploy                   # Ship to the workflow engine

Programmatic (SDK)

For applications that write or read events directly — microservices, Lambda functions, scripts, pipelines.

1. Install and authenticate

Install the SDK and authenticate your session:

npm install @loxtep/sdk
npx loxtep login

2. Write events to a data product

Use the SDK writer to publish typed event records to a data product stream:

import { LoxtepClient } from '@loxtep/sdk';

const client = new LoxtepClient({
  api_url: process.env.LOXTEP_API_URL,
  auth: { type: 'jwt', token: process.env.LOXTEP_AUTH_TOKEN! },
});

const writer = await client.get_writer('orders');
writer.write({
  order_id: 'ord_123',
  customer_id: 'cust_456',
  total_amount: 4999,
  created_at: new Date().toISOString(),
});
await writer.close();

The SDK resolves the data product's queue, bot identity, and stream bus configuration automatically. No manual queue names, no stream config, no bot IDs.

3. Read events back

Create an async reader to consume events from the data product stream:

const reader = await client.get_reader('orders');
for await (const event of reader) {
  console.log('Received:', event);
}

4. Query with SQL

Execute analytical SQL queries directly against the data product's Iceberg table:

const result = await client.build.data_products.query(
  'orders',
  "SELECT count(*) AS total FROM orders WHERE created_at > '2024-01-01'"
);
console.log(result.rows);

See the SDK documentation for the full API surface, streaming helpers, delivery interfaces, and error handling.


Web UI

Coming soon. The web UI is in limited preview. The sections below describe the workflow for when it launches. In the meantime, use the Agent, CLI, or SDK paths above.

{/* The web UI provides a visual interface for project setup, connector management, workflow building, and data exploration.

1. Sign in

Navigate to app.loxtep.io and sign in with your Loxtep account.

2. Create a project

Projects → New Project → Enter a name (e.g., "commerce-mesh") and optional description → Create.

3. Connect a data source

Connectors → Add Connector → Select your connector type (e.g., PostgreSQL) → Fill in connection details → Test Connection → Save.

Then wire it into your project: Project → Connections → Add Connection → Select your connector → Name it (e.g., "commerce-db") → Save.

4. Define a data product

Project → Data Products → New Data Product → Enter name ("orders"), select kind ("source"), define your schema fields → Create.

5. Build a workflow

Project → Workflows → New Workflow → Use the visual graph editor to:

  1. Add a source node (your connection)
  2. Add a destination node (your data product)
  3. Connect them with an edge
  4. Optionally add transform or validation nodes

6. Deploy

Workflow → Deploy → Select your target instance → Deploy.

7. Query

Analytics → New Query → Write SQL against your data product:

SELECT count(*) AS total_orders, sum(total_amount) / 100.0 AS revenue
FROM orders
WHERE created_at > '2024-01-01'

→ Run Query. */}


What You Have Built

Regardless of which path you chose, you now have:

  • A project organizing your data domain.
  • A connector bridging an external data source.
  • A source data product with a defined schema registered in the catalog.
  • A workflow automating data ingestion.
  • A deployed instance with live, queryable data.

Mix and Match

These paths are not exclusive. Common combinations:

  • Set up in the UI, operate with your agent — create projects and connectors visually, then use MCP for day-to-day queries and workflow iteration.
  • Scaffold with CLI, deploy from CI — loxtep init + loxtep generate locally, then loxtep deploy in your CI pipeline.
  • Agent for exploration, SDK for production — use your AI agent to prototype workflows, then embed the SDK in your microservices for production event streaming.

Build Advanced Data Products — Next Steps

After building your first data product:

  1. Create a consumer data product — Compose a derived view for a downstream team
  2. Seed your context layer — Import your org's knowledge and vocabulary (Getting Started — Seeding your Context Layer)
  3. Set up governance — Add quality rules, access control, and RBAC
  4. Operationalize — Monitor data flowing, troubleshoot issues, scale

Explore Further