Workspace Variables enable cross-workflow data sharing. Store a value in one workflow and retrieve it from another workflow in the same workspace.
Block Types
kaizen_set_workspace_var- Store a valuekaizen_get_workspace_var- Retrieve a value
Set Workspace Variable
Stores a key-value pair in workspace-scoped storage. Creates a new variable or updates an existing one.
Input Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Variable name (alphanumeric, underscores, must start with letter or underscore) |
value | any | Yes | Value to store, supports block references like <block.output> |
valueType | dropdown | No | Type: string, number, boolean, json, array (default: string) |
description | string | No | Optional description for the variable |
Outputs
| Output | Type | Description |
|---|---|---|
success | boolean | Whether the operation succeeded |
key | string | The variable key |
value | any | The stored value |
valueType | string | The value type |
isNew | boolean | True if created, false if updated existing |
message | string | Human-readable result message |
Get Workspace Variable
Retrieves a value from workspace-scoped storage.
Input Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Variable name to retrieve |
defaultValue | any | No | Fallback value if variable doesn't exist |
Outputs
| Output | Type | Description |
|---|---|---|
success | boolean | Whether the operation succeeded |
exists | boolean | Whether the variable exists |
key | string | The variable key |
value | any | Retrieved value (or defaultValue if not found) |
valueType | string | Type of the value (or null if not found) |
message | string | Human-readable result message |
Cross-Workflow Example
Workflow A - Creates bucket and stores ID:
# Kaizen Create Buckets block creates a bucket
# Then Set Workspace Variable stores the ID
inputs:
key: "active_bucket_id"
value: "<kaizen_create_buckets.bucketIds[0]>"
valueType: "string"
description: "Bucket ID for filtering in other workflows"Workflow B - Retrieves ID for filtering:
# Get Workspace Variable retrieves the stored ID
inputs:
key: "active_bucket_id"
# Then use the value in downstream blocks
# Reference: <kaizen_get_workspace_var.value>Common Use Cases
Share Bucket ID Between Workflows
# Workflow A: Store bucket after creation
Set Workspace Variable:
key: "my_project_bucket"
value: "<kaizen_create_buckets.bucketIds[0]>"
# Workflow B: Filter todos by that bucket
Get Workspace Variable:
key: "my_project_bucket"
defaultValue: ""
Kaizen Todos:
bucketId: "<kaizen_get_workspace_var.value>"Store Configuration Values
# Set multiple configuration values
Set Workspace Variable:
key: "max_items_per_run"
value: "50"
valueType: "number"
Set Workspace Variable:
key: "processing_enabled"
value: "true"
valueType: "boolean"Store Complex Data
# Store a JSON object
Set Workspace Variable:
key: "last_sync_state"
value: '{"timestamp": "2024-01-15", "count": 42}'
valueType: "json"
# Store an array
Set Workspace Variable:
key: "processed_ids"
value: "<some_block.resultIds>"
valueType: "array"Variables persist until explicitly deleted or overwritten. They are scoped to the workspace - all workflows in the workspace can access them.
Best Practices
- Use descriptive keys: Choose clear names like
active_bucket_idorlast_processed_todo - Provide defaults: Use
defaultValuein Get to handle missing variables gracefully - Check existence: Use the
existsoutput when you need to know if a variable was found - Don't store secrets: Use environment variables for sensitive data instead
- Consider workflow variables for internal state: Workspace Variables are for cross-workflow sharing; use the Variables block for workflow-internal state