Skip to content

SDK Overview

Use the platform SDKs to publish workflow versions, invoke Events, inspect runs, and manage project data from application code. TypeScript, Python, and Rust clients call the same REST API and use the caller’s existing permissions.

This documentation describes the SDK source in this repository. Newly added methods require this revision until a package release includes them. The Rust client is currently available as a source dependency.

LanguagePackageInstall
Node.js / TypeScript@flow-like/sdknpm install @flow-like/sdk
Pythonflow-likeuv add flow-like
Rustflow-like-platformUse the source crate

The clients cover workflow invocation, publication and editing, Event management, run history and logs, signed file transfers, database administration, app access, frontend resources, packages, connections, and device hub management. Complex management payloads retain the backend’s JSON field names. TypeScript and Python also include optional LanceDB connection and LangChain adapters; the Rust client provides database credentials and REST queries without those adapters.

Python exposes synchronous methods and a-prefixed async methods. TypeScript uses promises and async iterables. Rust uses async methods and an event stream.

Device hub methods manage inventory, grants, and deployments. They do not open the encrypted agent channel. Starting a device service or reading its local execution logs still uses device management; Rust applications can use the separate flow-like-device-client crate for that channel.

The TypeScript and Python source versions are prepared for a 0.2.0 release. Check these corrected contracts when upgrading:

APICaller change
TypeScript listFiles()Read the returned array directly. File entries use location, last_modified, and is_dir.
TypeScript countItems()Use the returned number directly.
TypeScript run status and poll eventsUse the backend names, including run_id, event_type, and payload.
TypeScript optional integrationsImport factories from @flow-like/sdk/langchain or @flow-like/sdk/lancedb when you need the peer library’s full types. Core factories expose common operations.
File uploadsSupply a destination key for bytes or an unnamed Blob.
presignData() / presign_data()Read scoped storage credentials and a path. Use the upload/download URL helpers for individual files.
PollingStart at sequence -1 to include the first event. Advance the cursor through all remaining pages, including after completion.

Python retains its FileInfo and CountResult wrappers. Complex management documents in all three clients follow the backend’s JSON field names.

Model discovery returns api_surface alongside bit_id. Use that field when choosing the client method:

api_surfaceNode.jsPythonRequest shape
ChatCompletions or absentchatCompletions()chat_completions()messages, max_tokens
Responsesresponses()responses()input, max_output_tokens

These are separate request and response contracts. The server rejects a model sent to the wrong endpoint with HTTP 400 and names the required route. See the Node.js examples and Python examples for discovery and calls.

The platform SDKs support these authentication methods:

TypePrefixHeader sentEnv variable
Personal Access Tokenpat_Authorization: pat_{id}.{secret}FLOW_LIKE_PAT
API Keyflk_X-API-Key: flk_{app}.{key}.{secret}FLOW_LIKE_API_KEY

The SDK sends PATs in Authorization and App API keys in X-API-Key. Use the explicit pat / apiKey options in Node.js, or pat / api_key in Python. Python also accepts a token option and detects its prefix. Provide one credential type at a time. Rust accepts an explicit Auth value or reads the same environment variables through Client::from_env().

Async invocations return a separate poll_token. Polling uses that token as Bearer authorization. Signed file transfers use the storage URL’s authorization; neither operation forwards the client’s platform credential.

Use these environment variables for client configuration:

Terminal window
export FLOW_LIKE_BASE_URL=https://api.flow-like.com
export FLOW_LIKE_PAT=pat_myid.mysecret
# or
export FLOW_LIKE_API_KEY=flk_appid.keyid.secret

The TypeScript and Python SDKs include optional LangChain-compatible wrappers so you can use Flow-Like models inside LangChain chains, agents, and RAG pipelines.

  • Node.js: import { FlowLikeChatModel, FlowLikeEmbeddings } from "@flow-like/sdk/langchain"
  • Python: from flow_like.langchain import FlowLikeChatModel, FlowLikeEmbeddings

See the language-specific pages for installation and usage details.