state.set
Operation: state.set
Category: state
Tags: state, storage, persistence
Write a value to persistent workspace state
Runtime
Section titled “Runtime”Type: Native (built-in)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)
Inputs
Section titled “Inputs”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namespace | String | Yes | — | State namespace (e.g., ‘engagement_model’) |
key | String | Yes | — | Key within the namespace |
value | JSON | Yes | — | Value to store (any JSON) |
Outputs
Section titled “Outputs”| Name | Type | Description |
|---|---|---|
success | Boolean | Whether the write succeeded |
import { WorkflowBuilder } from "@fabric-platform/sdk";
const workflow = new WorkflowBuilder("my-workflow") .node("state-set", "tool", (n) => n.config({ operation: "state.set", // ... node-specific config }) ) .build();from fabric_platform import FabricClient
fabric = FabricClient(api_key="fab_xxx")
wf_id = fabric.upsert_workflow("my-workflow", nodes=[ { "key": "state-set", "kind": "tool", },])use fabric_sdk::FabricClient;
let client = FabricClient::new("http://localhost:3001", api_key)?;
let wf_id = client.upsert_workflow("my-workflow", serde_json::json!({ "nodes": [{ "key": "state-set", "kind": "tool" }]})).await?;curl -X POST http://localhost:3001/v1/workflow-definitions \ -H "Authorization: Bearer $FABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "my-workflow", "nodes": [{ "key": "state-set", "kind": "tool" }] }'Example
Section titled “Example”{ "key": "save-model", "operation": "state.set", "inputs": [ { "name": "namespace", "path": "$context.state_ns" }, { "name": "key", "path": "$context.model_key" }, { "name": "value", "path": "$context.trained_model" } ], "outputs": [{ "name": "success", "path": "$context.save_ok" }]}Common Errors
Section titled “Common Errors”Missing required input: value
Section titled “Missing required input: value”Cause: The value input is not bound or resolves to null
Fix: Bind value to a context path containing the JSON data to store