Flow Studio
Persisting Execution State
When a workflow suspends, the entire ExecutionMemory — all node outputs, global variables, and execution metadata — is serialised to JSON and stored in Process_SuspendedExecutions. This is the full state needed to resume.
What Is Persisted
| Data | Field in Process_SuspendedExecutions |
|---|---|
| All node outputs collected so far | ExecutionMemory (JSON) |
| Global variables set by SetVariable nodes | Inside ExecutionMemory |
| Which node is suspended | SuspendedNodeId |
| The correlation token | ExecutionResId |
| The full process definition | Referenced by ProcessId + ThreadId — loaded fresh on resume |
| Timeout configuration | ExpiresAt, TimeoutBehavior, EscalationActorId |
Serialisation
// ExecutionMemorySerializer.cs
public string Serialize(ExecutionMemory memory)
{
// Uses System.Text.Json with custom converters for object type preservation
var options = new JsonSerializerOptions
{
WriteIndented = false,
Converters = { new ExecutionMemoryTypeConverter() }
};
return JsonSerializer.Serialize(memory, options);
}
public ExecutionMemory Deserialize(string json)
{
return JsonSerializer.Deserialize<ExecutionMemory>(json, _deserializeOptions)
?? throw new InvalidOperationException("Failed to deserialise ExecutionMemory");
}
Object Type Preservation
The nodeOutputs dictionary stores object values. The serialiser uses type discriminators to preserve the original .NET type, so GetNodeOutput<T> returns the correct strongly-typed object after deserialisation:
// Serialised as:
{
"nodeOutputs": {
"httpRequest1": {
"$type": "BizFirst.Ai.ExecutionNodes.Http.HttpRequestOutput",
"statusCode": 200,
"body": "{ \"id\": 123 }"
}
}
}
Non-serialisable objects: Node output objects must be JSON-serialisable. If an executor returns an output containing non-serialisable types (e.g., raw streams, delegates), suspension will fail with a
SerializationException. Use DTOs or primitives in output types.
Storage Size Limits
The ExecutionMemory column is NVARCHAR(MAX) — no hard SQL limit. However, very large memories (e.g., workflows that process large documents and store them in node outputs) can cause performance issues. Recommendations:
- Do not store binary content in node outputs — store a reference (URL, blob ID) instead.
- If a node processes large datasets, store results to a database or blob storage and put the ID in the output.
- The engine logs a warning if ExecutionMemory serialises to more than 1MB.