Storage & KV Store

Built-in file storage and key-value persistence for your integrations.

Storage & KV Store

Weavz includes two built-in workspace integrations for persistent data storage. Both are available without external authentication, can be configured with workspace integration aliases and persistence settings, and work alongside your other integrations.

For the full first-party catalog, see Built-In Workspace Integrations.

For agent and product workflows, add Storage and KV Store as workspace integrations first. Use stable aliases because those aliases become the names agents and SDK callers target, and set persistence on the workspace integration rather than in each action input.

bash
curl -X POST https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "alias": "files",
    "displayName": "Workspace Files",
    "settings": { "persistence": { "scope": "workspace" } }
  }'
 
curl -X POST https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "alias": "state",
    "displayName": "Workspace State",
    "settings": { "persistence": { "scope": "workspace" } }
  }'

After that, execute with workspaceId and integrationAlias (files or state). The configured persistence policy is applied automatically.

Storage Integration

The Storage integration provides file CRUD operations backed by object storage. Use it to store files, documents, and binary data.

Available Actions

ActionDescription
read_fileRead a file's contents by path
write_fileWrite content to a file (creates or overwrites)
delete_fileDelete a file by path
list_filesList files in a directory with optional prefix filter

Examples

Write a file:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "write_file",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "integrationAlias": "files",
    "input": {
      "path": "reports/monthly.json",
      "content": "{\"month\": \"January\", \"total\": 1500}"
    }
  }'

Read a file:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "read_file",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "path": "reports/monthly.json"
    }
  }'

List files:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "list_files",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "prefix": "reports/"
    }
  }'

KV Store Integration

The KV Store integration provides key-value persistence. Use it for caching, state management, counters, and simple data structures.

Available Actions

ActionDescription
putSet a key-value pair (string value)
getRetrieve the value for a key
deleteDelete a key-value pair
add_to_listAppend a value to a list stored at a key
remove_from_listRemove a value from a list stored at a key

Examples

Store a value:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "integrationAlias": "state",
    "input": {
      "key": "last_sync_timestamp",
      "value": "2025-01-15T10:00:00Z"
    }
  }'

Retrieve a value:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "get",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "key": "last_sync_timestamp"
    }
  }'

Manage lists:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "add_to_list",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "key": "processed_orders",
      "value": "order_123"
    }
  }'

Persistence Scope

Storage and KV Store use the workspace integration's settings.persistence policy to decide where persistent state is stored. Callers do not pass this as action input. This is separate from connection strategy: connection strategy chooses which credentials an action uses, while persistence scope chooses who can read and write the state created by the action.

ScopeValueDescription
Current end userend_user (default)Data is private to the end user for the current request. Requires endUserId in API calls.
Shared workspaceworkspaceData is shared by all users and agents in the workspace. Different workspaces cannot access each other's data.
Custom namespaceexternalData is scoped to a namespace key within the workspace. Configure that namespace key as settings.persistence.externalId. Useful for tenant, session, project, or entity-level isolation.

The dashboard labels the custom value as Namespace Key.

The same Persistence Scope model is also used by stateful built-in agent tools such as Agent Memory, Agent Scratchpad, and Sequential Thinking. Advanced Code uses settings.advancedCode.storageMountScope because sandbox storage mounting can also be disabled with none.

Current end user (default)

The default policy is end_user. When you pass endUserId in the action execution request, data is isolated per end user within the workspace.

Data stored with endUserId: "user_12345" is isolated from data stored with endUserId: "user_67890" or shared workspace data. This is the recommended approach for multi-tenant applications.

Shared workspace

Configure the workspace integration with settings.persistence.scope: "workspace" to share data across all end users in a workspace. Different workspaces cannot access each other's data.

bash
curl -X POST https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "alias": "workspace_files",
    "settings": {
      "persistence": { "scope": "workspace" }
    }
  }'

After adding the workspace integration, execute actions by targeting its workspaceIntegrationId or integrationAlias; the configured persistence policy is applied automatically.

Custom namespace

Configure settings.persistence.scope: "external" and provide settings.persistence.externalId as the namespace key. Use this when state should be isolated by something that is not the current end user, such as a tenant, session, project, or external entity.

bash
curl -X POST https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "alias": "tenant_kv",
    "settings": {
      "persistence": { "scope": "external", "externalId": "tenant_123" }
    }
  }'

Data stored with the external namespace key tenant_123 is isolated from data stored with namespace key tenant_456 or shared workspace data. The same namespace key in different workspaces is also fully isolated.

Use Cases

Caching

Cache API responses to reduce calls to rate-limited services:

bash
# Check cache
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "get",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "integrationAlias": "state",
    "input": { "key": "cache:slack:channels:W123" }
  }'

State Management

Track workflow state across multiple integration actions:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "kv-store",
    "actionName": "put",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "key": "sync:cust_123:status",
      "value": "in_progress"
    }
  }'

File Storage

Store generated reports, exports, or media:

bash
curl -X POST https://api.weavz.io/api/v1/actions/execute \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "storage",
    "actionName": "write_file",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "input": {
      "path": "exports/cust_123/report-2025-01.csv",
      "content": "name,amount\nAlice,100\nBob,200"
    }
  }'

Next Steps

Start using storage in the Playground or follow the Storage & KV guide.