Skip to content

state.set

Operation: state.set
Category: state
Tags: state, storage, persistence

Write a value to persistent workspace state

Type: Native (built-in)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)

NameTypeRequiredDefaultDescription
namespaceStringYesState namespace (e.g., ‘engagement_model’)
keyStringYesKey within the namespace
valueJSONYesValue to store (any JSON)
NameTypeDescription
successBooleanWhether 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();
{
"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" }]
}

Cause: The value input is not bound or resolves to null

Fix: Bind value to a context path containing the JSON data to store