Connectors and tool ecosystem
Unstract connects workflow runs to outside data stores and to reusable tools. Connectors bring files into a run or send results to another system. Tools process each file as a managed workflow step. The shared boundaries let workflows use different providers without changing their core flow.
Ecosystem role
The ecosystem joins three related capabilities. A connector gives a workflow a controlled path to data. A tool definition makes reusable work available by a stable identity. The tool runtime turns that choice into an isolated run and returns its outcome to the workflow.
| Capability | Purpose in a workflow | Main result |
|---|---|---|
| Connector | Read source data or write workflow results | A common file or output boundary |
| Tool catalog | Describe reusable work and its needs | A selectable tool identity |
| Tool runtime | Run the selected tool for a file | Status, result, and run data |
These boundaries keep provider access separate from workflow logic. A workflow stores its selected connector or tool with its settings. Execution resolves that saved choice when the run needs it.
Connector boundaries
Connectors are the access boundary between workflows and external systems. Each connector presents its identity, supported read or write role, settings, and credential needs. The platform uses this information to offer valid choices and the worker uses the saved choice to perform the operation.
Input connections
An input connection supplies files to a workflow. The source side validates the connection, opens the selected file system, and exposes a common view for finding files, reading content, and reading file metadata. This keeps local storage, object storage, and other file sources behind one workflow input model.
References: unstract/…/base.py• L7-78 unstract/…/unstract_file_system.py• L17-77 workers/…/source_connector.py• L76-147
Output connections
An output connection receives the result of a workflow run. The destination side can return a result through an API, copy files to storage, write records to a database, or send work to a review path. It also carries file context and error data so the receiver can relate the result to the source file.
References: workers/…/destination_connector.py• L599-739 workers/…/destination_connector.py• L766-836 unstract/…/unstract_db.py• L21-107
Connector identity and scope
The connector catalog gives each active connector a stable ID and describes its user-facing capabilities. A configured connector instance stores that ID with protected settings and organization scope. At run time, the worker resolves the ID and passes the settings to the access layer.
File-system connectors also define the scope of visible data. For example, the S3/MinIO connector requires a bucket and limits file operations to that bucket. Its discovery path filters out buckets that the credentials cannot browse. Unstract Cloud Storage uses its own path-based scope and does not use that bucket requirement. This keeps a connector from exposing account-wide storage when the workflow only needs one data area.
References: unstract/…/connectorkit.py• L16-32 unstract/…/connectorkit.py• L74-114 backend/…/models.py• L54-86 unstract/…/minio.py• L57-177 unstract/…/minio.py• L370-387 unstract/…/ucs.py• L8-21 unstract/…/json_schema.json• L1-45
For the package-level view of connector packages, see Connector platform.
Tool catalog and runtime
Tools are reusable workflow units with a defined purpose and run contract. A catalog entry describes the tool's identity, version, inputs, outputs, settings, runtime needs, and runnable image. The catalog can provide shared tools and tools that are local to one Unstract instance.
Tool availability
The tool registry is the source of truth for tool metadata and image references. The platform uses it to list available tools, build settings forms, validate choices, and resolve a tool by ID. Workflow state stores where the selected tool sits in the workflow and which settings it uses. The registry remains the owner of the tool definition.
References: unstract/…/tool_registry.py• L17-58 unstract/…/tool_registry.py• L122-160 backend/…/models.py• L19-44 backend/…/tool_processor.py• L31-81
Tool execution boundary
Workflow execution turns a selected tool into an isolated run for one file. It confirms that the tool is known and runnable, combines platform services with the selected settings, and asks the runner to start the tool. The runtime observes the run until it completes. Its result and status then become input for the next workflow stage.
The diagram shows how a saved tool choice becomes a workflow result.
flowchart LR
A[Workflow tool instance] --> B[Tool catalog]
B --> C[Tool metadata and image]
C --> D[Isolated tool run]
D --> E[Runner]
E --> F[Status and result]
F --> G[Workflow destination]
References: unstract/…/tools_utils.py• L74-180 unstract/…/tool_sandbox.py• L8-106 unstract/…/helper.py• L260-360
Tool run state
The tool runtime returns more than a final value. It exposes status, logs, errors, and execution history through the worker boundary. Execution tracking lets the worker inspect or resume a run by its execution ID. Cleanup closes the run boundary after success or failure so an old tool process does not remain active.
References: workers/…/tool_client.py• L30-89 workers/…/tool_client.py• L91-119 unstract/…/helper.py• L123-258 unstract/…/helper.py• L433-522
For the detailed catalog, sandbox, and service view, see Tool registry and execution runtime.
End-to-end data path
Connectors and tools form one workflow lifecycle. An input connector finds and reads a file. Workflow execution applies one or more tools. An output connector publishes the result or routes it for review. The worker keeps these roles separate so a workflow can read from one provider and write to another.
The diagram shows the main hand-offs from source data to a published result.
sequenceDiagram
participant Source as Input connector
participant Worker as Workflow worker
participant Tool as Tool runtime
participant Destination as Output connector
Source->>Worker: Find and read workflow files
Worker->>Tool: Start tool for one file
Tool-->>Worker: Return result, status, and metadata
Worker->>Destination: Publish result or route for review
Destination-->>Worker: Confirm output handling
Destination processing also protects against duplicate writes when execution is retried or resumed. The output system therefore completes the workflow contract rather than acting as a simple final file transfer.
References: workers/…/source_connector.py• L149-205 workers/…/destination_connector.py• L852-904 workers/…/destination_connector.py• L435-560
SDK and service integrations
SDK and service integrations extend the same workflow boundaries to external callers and runtime services. The SDK-facing layer makes Unstract capabilities available to applications. The LLM runtime supports model-backed workflow work without changing how connectors move data or how the tool runtime reports execution.
For SDK integration details, see SDK and LLM runtime. For connector package details, see Connector platform. For tool service details, see Tool registry and execution runtime.
References: backend/…/models.py• L54-86 workers/…/tool_client.py• L30-119
Change checklist
When these files or sections are changed, remember to consider these:
- When a connector ID, mode, scope, or read/write capability changes, check the catalog response, connector-instance data, source validation, and destination routing together.
- When a connector setting or schema changes, check the platform form and the worker code that passes the setting to the connector.
- When a storage scope changes, check both discovery and file walking. A path that is correct in the browser must also be correct for workflow file discovery.
- When storage access errors change, check which errors are hidden, retried, or surfaced. This choice affects whether users see a missing bucket or a real credential or system failure.
- When a tool image, tag, or tool ID changes, check registry metadata, stored tool instances, image checks, and runner requests as one contract.
- When tool status or result fields change, check status tracking, worker retrieval, destination handling, and the execution API response.
- When output metadata changes, check API result caching and database writes because both consume the same workflow result boundary.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A source has no connector ID, required setting, or valid scope | The worker cannot create the file access object and the workflow cannot read its input | Source validation and connector settings reject incomplete access data before the run |
| A storage connector lists buckets that the credentials cannot browse | Users see unusable choices or a later file operation fails | S3/MinIO probes bucket access, drops known inaccessible buckets, and surfaces unknown system errors |
| A bucket-scoped file entry keeps its account-level path | File discovery can build a wrong path and fail when it opens the file | The scoped file view returns paths relative to the configured bucket |
| A tool has no registry record, image, or required property | The workflow cannot build a runnable tool step | Tool loading and instance validation check the registry entry before execution |
| A tool run does not report a final status | The run becomes an execution error after the poll limit | The runtime tracks status, applies a time limit, and cleans up the tool process |
| A destination receives no result or recorded error | The output write fails instead of publishing incomplete data | Destination handlers require a result or error before writing |
| A retry reaches a destination after the file was already handled | A duplicate output could be written | Destination processing uses per-file execution state to keep the first output authoritative |
Key files
| File | Why to read it |
|---|---|
| unstract/…/connectorkit.py | Shows the shared connector catalog and stable-ID lookup |
| unstract/…/base.py | Defines the common connector capabilities |
| unstract/…/unstract_file_system.py | Describes the common file-source and file-destination boundary |
| unstract/…/minio.py | Shows storage scope and access behavior for S3-compatible systems |
| unstract/…/ucs.py | Shows how Unstract Cloud Storage uses a different scope model |
| unstract/…/json_schema.json | Shows the user-facing settings for S3/MinIO access |
| backend/…/models.py | Shows how an organization stores a configured connector instance |
| workers/…/source_connector.py | Shows how workflow input becomes a common file-reading operation |
| workers/…/destination_connector.py | Shows how a tool result reaches an API, file store, database, or review path |
| unstract/…/tool_registry.py | Shows how tool definitions and images become available |
| backend/…/models.py | Shows the workflow-owned record for a selected tool and its step order |
| unstract/…/tools_utils.py | Shows how execution prepares and runs tool steps |
| unstract/…/tool_sandbox.py | Shows the boundary for starting an isolated tool run |
| unstract/…/helper.py | Shows runner communication, status polling, and cleanup |