Documentation
¶
Index ¶
- Constants
- func ApplyWorkflowCredentials(w WorkflowInterface, creds map[string]map[string]string)
- func CredentialKeys(nodeType string) []string
- func ExportDOT(workflow WorkflowInterface, statuses map[string]string) string
- func ExportNodeRED(w WorkflowInterface) ([]byte, error)
- func ExtractWorkflowCredentials(w WorkflowInterface, existing map[string]map[string]string) map[string]map[string]string
- func ImportChildFlow(w WorkflowInterface, raw []byte) ([]string, error)
- func IsComponentInstance(nodeType string) bool
- func IsCredentialKey(nodeType, key string) bool
- func IsCredentialSentinel(v any) bool
- func MarshalPayloadJSON(payload any) ([]byte, error)
- func ParentMsgID(p MessageInterface) string
- func RegisterCredentialKeys(typeID string, keys []string)
- func SetTravelInstanceID(p MessageInterface, id string)
- func SetTravelParentInstanceID(p MessageInterface, id string)
- func TravelInstanceID(p MessageInterface) string
- func TravelParentInstanceID(p MessageInterface) string
- func UnmarshalPayloadJSON(raw []byte) (any, error)
- type ChildFlowExport
- type ContextValueStoreInterface
- type CoordinationSignal
- type CoordinationWaiter
- type CredentialCipher
- type CredentialInterface
- type CredentialQueryInterface
- type DeployRecordInterface
- type DeployRecordQueryInterface
- type EdgeInterface
- type EdgeQueryInterface
- type EntityCoordinationStore
- func (s *EntityCoordinationStore) AckWaiter(ctx context.Context, waiterID, claimToken string) error
- func (s *EntityCoordinationStore) IncrementSignal(ctx context.Context, key string, metadata map[string]interface{}, ...) error
- func (s *EntityCoordinationStore) NackWaiter(ctx context.Context, waiterID, claimToken string) error
- func (s *EntityCoordinationStore) ParkWaiter(ctx context.Context, waiter CoordinationWaiter) error
- func (s *EntityCoordinationStore) PollWaiters(ctx context.Context, workflowID, nodeID string) ([]CoordinationWaiter, []CoordinationWaiter, error)
- func (s *EntityCoordinationStore) SetCoordinationClaimTTLForTest(ttl time.Duration)
- func (s *EntityCoordinationStore) Signal(ctx context.Context, key string) (CoordinationSignal, bool, error)
- func (s *EntityCoordinationStore) Waiters(ctx context.Context, workflowID, nodeID string) ([]CoordinationWaiter, error)
- type EntityInboxStore
- func (s *EntityInboxStore) ApplyRunLocationOperation(ctx context.Context, req RunLocationOperationRequest) (*RunLocationView, error)
- func (s *EntityInboxStore) BeginInboxWriteSet(ctx context.Context) (RunInboxWriteSet, error)
- func (s *EntityInboxStore) ClaimInboxItem(workflowID, id, runnerID string, ttl time.Duration) (bool, error)
- func (s *EntityInboxStore) DeleteInboxItem(workflowID, id string) error
- func (s *EntityInboxStore) DeleteInboxItemAtNode(workflowID, nodeID, id string) error
- func (s *EntityInboxStore) DeleteWorkflowInbox(workflowID string) error
- func (s *EntityInboxStore) JournalArrived(item *RunInboxItem) error
- func (s *EntityInboxStore) JournalOptions() JournalOptions
- func (s *EntityInboxStore) JournalReleased(workflowID, instanceID, nodeID, runnerID, reason string) error
- func (s *EntityInboxStore) LoadInbox(workflowID string) ([]RunInboxItem, error)
- func (s *EntityInboxStore) LoadInboxFor(workflowID, runnerID string) ([]RunInboxItem, error)
- func (s *EntityInboxStore) ParkedJournalInstances(ctx context.Context, workflowID string) (map[string][]string, error)
- func (s *EntityInboxStore) ReleaseInboxClaim(workflowID, id, runnerID string) error
- func (s *EntityInboxStore) RunLocation(ctx context.Context, workflowID, itemID string) (*RunLocationView, error)
- func (s *EntityInboxStore) RunLocationItem(ctx context.Context, workflowID, itemID string) (*RunLocationView, *RunInboxItem, error)
- func (s *EntityInboxStore) RunLocations(ctx context.Context, workflowID string) ([]RunLocationView, error)
- func (s *EntityInboxStore) SaveInboxItem(item *RunInboxItem) error
- func (s *EntityInboxStore) SetJournalOptions(opts JournalOptions)
- func (s *EntityInboxStore) SetTravellerExecution(enabled bool)
- func (s *EntityInboxStore) SweepJournal(ctx context.Context) error
- func (s *EntityInboxStore) TravellerExecution() bool
- func (s *EntityInboxStore) WithJournalOptions(opts JournalOptions) *EntityInboxStore
- func (s *EntityInboxStore) WithTravellerExecution() *EntityInboxStore
- type EntityLeaseStore
- func (s *EntityLeaseStore) ClaimLease(workflowID, runnerID string, ttl time.Duration) (bool, string, error)
- func (s *EntityLeaseStore) ListLeases() ([]WorkflowLease, error)
- func (s *EntityLeaseStore) ListRunners() ([]Runner, error)
- func (s *EntityLeaseStore) ReleaseLease(workflowID, runnerID string) error
- func (s *EntityLeaseStore) RenewLease(workflowID, runnerID string, ttl time.Duration) (bool, error)
- func (s *EntityLeaseStore) UpsertRunner(r Runner) error
- type JournalEdgeView
- type JournalEmitted
- type JournalEventView
- type JournalInstanceView
- type JournalLineageView
- type JournalOptions
- type JournalSlice
- type MessageInterface
- type MessageQueryInterface
- type NewStoreOptions
- type NodeGroupInterface
- type NodeGroupQueryInterface
- type NodeInterface
- type NodeQueryInterface
- type RunInboxItem
- type RunInboxWriteSet
- type RunLocationOperationRequest
- type RunLocationView
- type RunStores
- type Runner
- type Store
- func (st *Store) ConfigGet(ctx context.Context, key string) (string, error)
- func (st *Store) ConfigSet(ctx context.Context, key string, value string) error
- func (st *Store) ContextValueDelete(ctx context.Context, scope, scopeID, key string) error
- func (st *Store) ContextValueDeleteByWorkflowID(ctx context.Context, workflowID string) error
- func (st *Store) ContextValueDeleteScope(ctx context.Context, scope, scopeID string) error
- func (st *Store) ContextValueGet(ctx context.Context, scope, scopeID, key string) (string, bool, error)
- func (st *Store) ContextValueKeys(ctx context.Context, scope, scopeID string) ([]string, error)
- func (st *Store) ContextValueSet(ctx context.Context, workflowID, scope, scopeID, key, value string) error
- func (st *Store) CredentialCount(ctx context.Context, query CredentialQueryInterface) (int64, error)
- func (st *Store) CredentialCreate(ctx context.Context, credential CredentialInterface) error
- func (st *Store) CredentialDeleteByID(ctx context.Context, id string) error
- func (st *Store) CredentialDeleteByWorkflowID(ctx context.Context, workflowID string) error
- func (st *Store) CredentialFindByID(ctx context.Context, id string) (CredentialInterface, error)
- func (st *Store) CredentialFindByNode(ctx context.Context, workflowID, nodeID string) (CredentialInterface, error)
- func (st *Store) CredentialList(ctx context.Context, query CredentialQueryInterface) ([]CredentialInterface, error)
- func (st *Store) CredentialMapForWorkflow(ctx context.Context, workflowID string) (map[string]map[string]string, error)
- func (st *Store) CredentialReplaceForWorkflow(ctx context.Context, workflowID string, creds map[string]map[string]string) error
- func (st *Store) CredentialUpdate(ctx context.Context, credential CredentialInterface) error
- func (st *Store) DeployRecordCount(ctx context.Context, query DeployRecordQueryInterface) (int64, error)
- func (st *Store) DeployRecordCreate(ctx context.Context, record DeployRecordInterface) error
- func (st *Store) DeployRecordDeleteByID(ctx context.Context, id string) error
- func (st *Store) DeployRecordDeleteByWorkflowID(ctx context.Context, workflowID string) error
- func (st *Store) DeployRecordFindByID(ctx context.Context, id string) (DeployRecordInterface, error)
- func (st *Store) DeployRecordList(ctx context.Context, query DeployRecordQueryInterface) ([]DeployRecordInterface, error)
- func (st *Store) EdgeCount(ctx context.Context, query EdgeQueryInterface) (int64, error)
- func (st *Store) EdgeCreate(ctx context.Context, edge EdgeInterface) error
- func (st *Store) EdgeDeleteByID(ctx context.Context, id string) error
- func (st *Store) EdgeFindByID(ctx context.Context, id string) (EdgeInterface, error)
- func (st *Store) EdgeList(ctx context.Context, query EdgeQueryInterface) ([]EdgeInterface, error)
- func (st *Store) EdgeUpdate(ctx context.Context, edge EdgeInterface) error
- func (st *Store) EnableDebug(debugEnabled bool) StoreInterface
- func (st *Store) GetDB() *sql.DB
- func (st *Store) GetEntityStore() entitystore.StoreInterface
- func (st *Store) JournalInstance(ctx context.Context, workflowID, instanceID string) (*JournalInstanceView, error)
- func (st *Store) JournalInstances(ctx context.Context, workflowID string) ([]JournalInstanceView, error)
- func (st *Store) JournalLineage(ctx context.Context, workflowID, instanceID string) (*JournalLineageView, error)
- func (st *Store) JournalTimeline(ctx context.Context, workflowID, instanceID string) ([]JournalEventView, error)
- func (st *Store) MessageCount(ctx context.Context, query MessageQueryInterface) (int64, error)
- func (st *Store) MessageCreate(ctx context.Context, message MessageInterface) error
- func (st *Store) MessageDeleteByID(ctx context.Context, id string) error
- func (st *Store) MessageFindByID(ctx context.Context, id string) (MessageInterface, error)
- func (st *Store) MessageList(ctx context.Context, query MessageQueryInterface) ([]MessageInterface, error)
- func (st *Store) MessageUpdate(ctx context.Context, message MessageInterface) error
- func (st *Store) MigrateViewGroups(ctx context.Context) (int, error)
- func (st *Store) MigrateWorkflowBlobAttributes(ctx context.Context) (int, error)
- func (st *Store) MigrateWorkflowGroupsConfig(ctx context.Context, configKey string) (int, error)
- func (st *Store) NodeCount(ctx context.Context, query NodeQueryInterface) (int64, error)
- func (st *Store) NodeCreate(ctx context.Context, node NodeInterface) error
- func (st *Store) NodeDeleteByID(ctx context.Context, id string) error
- func (st *Store) NodeFindByID(ctx context.Context, id string) (NodeInterface, error)
- func (st *Store) NodeGroupCount(ctx context.Context, query NodeGroupQueryInterface) (int64, error)
- func (st *Store) NodeGroupCreate(ctx context.Context, group NodeGroupInterface) error
- func (st *Store) NodeGroupDeleteByID(ctx context.Context, id string) error
- func (st *Store) NodeGroupFindByID(ctx context.Context, id string) (NodeGroupInterface, error)
- func (st *Store) NodeGroupList(ctx context.Context, query NodeGroupQueryInterface) ([]NodeGroupInterface, error)
- func (st *Store) NodeGroupUpdate(ctx context.Context, group NodeGroupInterface) error
- func (st *Store) NodeList(ctx context.Context, query NodeQueryInterface) ([]NodeInterface, error)
- func (st *Store) NodeUpdate(ctx context.Context, node NodeInterface) error
- func (st *Store) WorkflowCount(ctx context.Context, query WorkflowQueryInterface) (int64, error)
- func (st *Store) WorkflowCreate(ctx context.Context, workflow WorkflowInterface) error
- func (st *Store) WorkflowDeleteByID(ctx context.Context, id string) error
- func (st *Store) WorkflowFindByID(ctx context.Context, id string) (WorkflowInterface, error)
- func (st *Store) WorkflowFindByName(ctx context.Context, name string) (WorkflowInterface, error)
- func (st *Store) WorkflowGroupCount(ctx context.Context, query WorkflowGroupQueryInterface) (int64, error)
- func (st *Store) WorkflowGroupCreate(ctx context.Context, group WorkflowGroupInterface) error
- func (st *Store) WorkflowGroupDeleteByID(ctx context.Context, id string) error
- func (st *Store) WorkflowGroupFindByID(ctx context.Context, id string) (WorkflowGroupInterface, error)
- func (st *Store) WorkflowGroupList(ctx context.Context, query WorkflowGroupQueryInterface) ([]WorkflowGroupInterface, error)
- func (st *Store) WorkflowGroupUpdate(ctx context.Context, group WorkflowGroupInterface) error
- func (st *Store) WorkflowList(ctx context.Context, query WorkflowQueryInterface) ([]WorkflowInterface, error)
- func (st *Store) WorkflowTrashByID(ctx context.Context, id string) error
- func (st *Store) WorkflowUpdate(ctx context.Context, workflow WorkflowInterface) error
- type StoreInterface
- type WorkflowGroupInterface
- type WorkflowGroupQueryInterface
- type WorkflowInterface
- type WorkflowLease
- type WorkflowQueryInterface
Constants ¶
const ( EdgeCopy = "copy" EdgeTransform = "transform" EdgeJoinInput = "join-input" EdgeSynthesized = "synthesized" )
Lineage edge types — exported because the engine's identity-rule table emits the same values.
const ( JournalEventMinimal = "minimal" JournalEventLifecycle = "lifecycle" JournalEventVerbose = "verbose" )
Journal event granularity tiers (GOD ruling: hop + claim/release lifecycle, configurable). "lifecycle" is the default.
const ( JournalPayloadHash = "hash" JournalPayloadOnChange = "on-change" JournalPayloadFull = "full" )
Journal payload capture tiers (GOD ruling: payload-on-change, configurable). "on-change" is the default.
const ( TravelInstanceMetaKey = "travellerInstanceId" TravelParentInstanceMetaKey = "travellerParentInstanceId" )
Traveller identity metadata is engine-owned. The payload envelope ID remains unique per edge clone; these keys carry the journal's logical instance IDs through the same payload so persistence and fan-out do not change delivery semantics.
const ( RunLocationKindInbox = "inbox" RunLocationKindTraveller = "traveller" )
const ( RunLocationOperationHold = "hold" RunLocationOperationRelease = "release" RunLocationOperationRetry = "retry" RunLocationOperationDelete = "delete" RunLocationOperationMove = "move" )
const ASC = "asc"
const ATTRIBUTE_ACTOR = "actor"
Attribute keys (persisted in the entity store attributes table)
const ATTRIBUTE_CONTEXT_KEY = "context_key"
const ATTRIBUTE_DATA = "data"
const ATTRIBUTE_DEPLOYED = "deployed"
const ATTRIBUTE_DESCRIPTION = "description"
const ATTRIBUTE_EDGES = "edges" // legacy: JSON blob on workflow entities
Legacy attribute keys — never written anymore, only read as a fallback when loading pre-migration records and cleaned up by entityAttributesReplace (they are in each type's managed key set).
const ATTRIBUTE_ERROR = "error"
const ATTRIBUTE_FLOW = "flow"
const ATTRIBUTE_GROUP_ID = "group_id"
const ATTRIBUTE_METADATA = "metadata"
const ATTRIBUTE_NAME = "name"
const ATTRIBUTE_NODES = "nodes" // legacy: JSON blob on workflow entities
const ATTRIBUTE_NODE_ID = "node_id"
const ATTRIBUTE_PARENT_ID = "parent_id"
const ATTRIBUTE_PAUSED = "paused"
const ATTRIBUTE_PAYLOAD = "payload"
const ATTRIBUTE_POSITION = "position"
const ATTRIBUTE_SCOPE = "scope"
const ATTRIBUTE_SCOPE_ID = "scope_id"
const ATTRIBUTE_SOURCE = "source"
const ATTRIBUTE_SOURCE_KEY = "source_key"
const ATTRIBUTE_TARGET = "target"
const ATTRIBUTE_TARGET_KEY = "target_key"
const ATTRIBUTE_TIMESTAMP = "timestamp" // legacy: duplicated entity created_at on messages
const ATTRIBUTE_TYPE = "type"
const ATTRIBUTE_VALUE = "value"
const ATTRIBUTE_VIEW = "view"
const ATTRIBUTE_WORKFLOWS = "workflows"
const ATTRIBUTE_WORKFLOW_ID = "workflow_id"
const AttributeConfigValue = "value"
AttributeConfigValue holds a config entry's raw string payload
const BinaryPayloadEncodingBase64 = "base64"
BinaryPayloadEncodingBase64 is the only supported binary wire encoding.
const BinaryPayloadWireKey = "$binary"
BinaryPayloadWireKey is the reserved single-key object used to encode byte slices inside JSON payload trees: {"$binary":{"encoding":"base64","data":"..."}}. A plain object with exactly this shape is therefore reserved in durable payload storage; ordinary strings (including base64-looking strings saved by older versions) remain strings because they carry no type marker.
const CredentialSentinel = "__PWRD__"
CredentialSentinel is the marker stored in node.Data in place of a real credential value (the same convention Node-RED's editor uses, "__PWRD__"). Stored workflows and editor payloads carry the sentinel where a secret exists; the actual value lives in server-side credential storage and is merged back into node.Data at deploy time. Exports must strip sentinel values and credential keys entirely.
const DESC = "desc"
const DefaultJournalRetention = 30 * 24 * time.Hour
DefaultJournalRetention is the documented default retention window.
const DeployRecordRetention = 20
DeployRecordRetention caps the deploy history kept per workflow — the last N records survive, older ones are pruned on append (same cap flowadmin used).
const EntityTypeConfig = "config"
EntityTypeConfig is the entity type for child-flow-level key/value config
const EntityTypeContextValue = "context_value"
const EntityTypeCredential = "credential"
Entity types stored in the underlying entity store
const EntityTypeDeployRecord = "deploy_record"
const EntityTypeEdge = "edge"
const EntityTypeMessage = "message"
const EntityTypeNode = "node"
const EntityTypeNodeGroup = "node_group"
const EntityTypeWorkflow = "workflow"
const EntityTypeWorkflowGroup = "workflow_group"
const JournalSweepBatchSize = 500
JournalSweepBatchSize bounds one retention pass. The engine calls the sweep periodically, so each invocation removes at most this many entities per type instead of turning a large expired history into one unbounded delete loop.
const NodeStatusError = "error"
const NodeStatusOK = "ok"
const NodeStatusRunning = "running"
Node status vocabulary produced by workflow runners. These values are storage/domain vocabulary, not engine implementation details: exporters, admin surfaces and runners can share them without reversing the import direction. NodeStatusOK is the current completion value produced by noderun; renaming it is a separate standardization decision.
Variables ¶
This section is empty.
Functions ¶
func ApplyWorkflowCredentials ¶
func ApplyWorkflowCredentials(w WorkflowInterface, creds map[string]map[string]string)
ApplyWorkflowCredentials merges stored credentials into node.Data so a deploy hands executors the real values while storage keeps only sentinel markers. Mutates the workflow in place — callers deploy a clone (the engine deploy path clones before expansion, so stored entities are never tainted).
func CredentialKeys ¶
CredentialKeys returns the config keys of a node type that are treated as credentials (masked in the editor, stored outside the exported flow document, stripped from exports).
func ExportDOT ¶ added in v0.6.0
func ExportDOT(workflow WorkflowInterface, statuses map[string]string) string
ExportDOT returns workflow as deterministic DOT graph text. Nodes are sorted by ID and edges by source/source port/target/target port/ID, so exporting the same workflow always produces the same text.
statuses is an optional overlay keyed by node ID. When it is nil the graph is purely structural. When it is non-nil, every node receives a fill color: running is blue, ok/complete/completed are green, error/failed are red, paused is yellow, and absent or unrecognized statuses use the default gray fill.
Edges whose source or target node is absent from the workflow are skipped. DOT creates implicit nodes for otherwise-unknown endpoints, which would silently invent graph structure the stored workflow does not contain.
func ExportNodeRED ¶
func ExportNodeRED(w WorkflowInterface) ([]byte, error)
ExportNodeRED converts a workflow into the Node-RED flow JSON array shape. Node-RED subflow definitions unfold: the type:"subflow" object is followed by its internal nodes as flat objects with z = <defId>.
func ExtractWorkflowCredentials ¶
func ExtractWorkflowCredentials(w WorkflowInterface, existing map[string]map[string]string) map[string]map[string]string
ExtractWorkflowCredentials moves credential values out of every node in the workflow into a nodeID → key → value map, leaving sentinel markers in node.Data. existing is the previously stored credential map (nil on create) used to preserve values the editor sent back as sentinels or omitted entirely. Persist the result via CredentialReplaceForWorkflow.
func ImportChildFlow ¶ added in v0.4.0
func ImportChildFlow(w WorkflowInterface, raw []byte) ([]string, error)
ImportChildFlow merges a child flow envelope into w as a NEW child flow. All ids are re-minted (child flow, nodes, edges, groups, definitions and their internal graphs) and every intra-payload reference is rewritten; references pointing outside the payload are kept verbatim and reported in the returned warnings when they do not resolve against the target workflow. Returns the list of warnings.
func IsComponentInstance ¶ added in v0.4.0
IsComponentInstance reports whether nodeType names a component instance ("component:<defId>").
func IsCredentialKey ¶
IsCredentialKey reports whether key is a credential field on the given node type.
func IsCredentialSentinel ¶
IsCredentialSentinel reports whether v is the sentinel string left in place of a stored credential value.
func MarshalPayloadJSON ¶ added in v0.5.1
MarshalPayloadJSON serializes a payload for durable JSON storage while preserving byte identity. Every []byte in the payload tree is encoded as the reserved BinaryPayloadWireKey object; plain JSON strings, objects, arrays, numbers, booleans and nil keep their ordinary JSON representation.
func ParentMsgID ¶ added in v0.7.0
func ParentMsgID(p MessageInterface) string
ParentMsgID extracts the producing instance's envelope ID from a payload's lineage metadata (stamped by the payload clone helper on every fan-out copy).
func RegisterCredentialKeys ¶
RegisterCredentialKeys marks config keys of a node type as credentials — the same treatment built-in types get: the editor masks them, storage moves them out of the flow document behind the CredentialSentinel marker, and exports strip them. Re-calling replaces the key list for the type.
func SetTravelInstanceID ¶ added in v0.12.0
func SetTravelInstanceID(p MessageInterface, id string)
SetTravelInstanceID stamps the logical traveller instance ID on a payload.
func SetTravelParentInstanceID ¶ added in v0.12.0
func SetTravelParentInstanceID(p MessageInterface, id string)
SetTravelParentInstanceID stamps the child's primary logical parent.
func TravelInstanceID ¶ added in v0.12.0
func TravelInstanceID(p MessageInterface) string
TravelInstanceID returns the logical traveller instance ID stamped by the engine. Older payloads have no stamp; callers may fall back to the envelope ID for compatibility with pre-journal rows.
func TravelParentInstanceID ¶ added in v0.12.0
func TravelParentInstanceID(p MessageInterface) string
TravelParentInstanceID returns the primary logical parent used to inherit a child's root. Additional join parents are represented by lineage edges.
func UnmarshalPayloadJSON ¶ added in v0.5.1
UnmarshalPayloadJSON decodes a payload written by MarshalPayloadJSON. Valid binary wire objects decode back to []byte; all ordinary JSON values decode with encoding/json's normal types. A malformed reserved binary object is an error so corrupt durable rows cannot silently change type.
Types ¶
type ChildFlowExport ¶ added in v0.4.0
type ChildFlowExport struct {
// Format identifies the envelope kind; always "child_flow".
Format string `json:"nodestore"`
// Version is the envelope schema version.
Version int `json:"version"`
// ChildFlow carries the meta entity {id,label,role,enabled,env}.
ChildFlow map[string]any `json:"child_flow"`
// Nodes are the child flow's nodes (backend shape; data.child flow is
// implied by the envelope and omitted).
Nodes []NodeInterface `json:"nodes"`
// Edges are the edges whose endpoints both live in the child flow.
Edges []EdgeInterface `json:"edges"`
// Groups are the view.groups entries belonging to the child flow.
Groups []any `json:"groups,omitempty"`
// Defs are the type:"component" definition nodes the child flow's
// component:<id> instances reference, resolved transitively
// (a definition may itself instantiate another definition).
Defs []NodeInterface `json:"defs,omitempty"`
// Warnings lists references that point outside the payload —
// kept verbatim in the export, so they only resolve when the
// target workflow already contains the referenced nodes.
Warnings []string `json:"warnings,omitempty"`
}
ChildFlowExport is the portable single-child flow payload.
func ExportChildFlow ¶ added in v0.4.0
func ExportChildFlow(w WorkflowInterface, flowRef string) (*ChildFlowExport, error)
ExportChildFlow builds the portable envelope for one child flow of w. flowRef is a child flow id or label. Nodes are the workflow nodes whose data.child flow resolves to the child flow; edges are those fully inside the set; groups and component definitions follow. References pointing at nodes outside the child flow are kept verbatim and listed in Warnings.
func ExportComponentDef ¶ added in v0.4.0
func ExportComponentDef(w WorkflowInterface, defID string) (*ChildFlowExport, error)
ExportComponentDef builds a child flow envelope carrying a single component definition (plus any definitions it nests). The envelope's child flow entity is a role:"component" template named after the definition, so importing it produces a navigable child flow plus a working definition.
func (ChildFlowExport) MarshalJSON ¶ added in v0.4.0
func (e ChildFlowExport) MarshalJSON() ([]byte, error)
MarshalJSON serializes the interface-typed node/edge slices through their persisted JSON shapes.
func (*ChildFlowExport) UnmarshalJSON ¶ added in v0.4.0
func (e *ChildFlowExport) UnmarshalJSON(raw []byte) error
UnmarshalJSON decodes the wire form back into interface-typed domain objects.
type ContextValueStoreInterface ¶ added in v0.5.0
type ContextValueStoreInterface interface {
ContextValueGet(ctx context.Context, scope, scopeID, key string) (value string, ok bool, err error)
ContextValueSet(ctx context.Context, workflowID, scope, scopeID, key, value string) error
ContextValueDelete(ctx context.Context, scope, scopeID, key string) error
ContextValueDeleteScope(ctx context.Context, scope, scopeID string) error
ContextValueKeys(ctx context.Context, scope, scopeID string) ([]string, error)
ContextValueDeleteByWorkflowID(ctx context.Context, workflowID string) error
}
ContextValueStoreInterface is the narrow persistence contract for runtime context values. Values are opaque serialized strings here — the runtime-facing adapter owns JSON encoding and Node-RED scope semantics, while nodestore owns durable storage and workflow-owned cleanup. The interface is kept separate from StoreInterface so embedders with custom stores can opt in structurally.
type CoordinationSignal ¶ added in v0.7.0
CoordinationSignal is the observable state of one release signal.
type CoordinationWaiter ¶ added in v0.7.0
type CoordinationWaiter struct {
ID string
SignalKey string
WorkflowID string
NodeID string
TargetCount int64
Message MessageInterface
ExpiresAt time.Time
CreatedAt time.Time
CachedMetadata map[string]interface{}
ClaimToken string
ClaimExpiresAt time.Time
}
CoordinationWaiter is one durably parked message.
type CredentialCipher ¶ added in v0.2.0
type CredentialCipher interface {
// Encrypt returns the sealed (self-describing) form of plaintext.
Encrypt(plaintext []byte) (string, error)
// Decrypt opens a sealed value. Implementations must pass
// through values that are not in their sealed format so legacy
// plaintext rows still decode.
Decrypt(sealed string) ([]byte, error)
}
CredentialCipher seals the credential value map before it is persisted into the entity attribute (encryption at rest) and opens it on read. The Node-RED analogue is flows_cred.json's credentialSecret.
func NewAESCredentialCipher ¶ added in v0.2.0
func NewAESCredentialCipher(key []byte) (CredentialCipher, error)
NewAESCredentialCipher returns a CredentialCipher using AES-256-GCM with the given 32-byte key. The key is copied — callers may zero their buffer afterwards.
type CredentialInterface ¶
type CredentialInterface interface {
GetID() string
SetID(id string) CredentialInterface
GetWorkflowID() string
SetWorkflowID(workflowID string) CredentialInterface
GetNodeID() string
SetNodeID(nodeID string) CredentialInterface
// GetValues returns the stored key→value credential map.
GetValues() map[string]string
SetValues(values map[string]string) CredentialInterface
// GetValue returns one stored credential value ("" when unset).
GetValue(key string) string
// SetValue upserts one credential key; an empty value removes it.
SetValue(key, value string) CredentialInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) CredentialInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) CredentialInterface
}
CredentialInterface is the entity form of a node's stored secrets — one entity per (workflow, node) pair carrying a key→value map. The workflow document keeps only CredentialSentinel markers; the real values live here and are merged back into node.Data at deploy time (Node-RED flows_cred.json convention).
func NewCredential ¶
func NewCredential(workflowID, nodeID string) CredentialInterface
NewCredential creates a new credential entity for a node. The ID may be left empty (entitystore assigns one); callers that need a deterministic handle (workflowID:nodeID) can SetID themselves.
type CredentialQueryInterface ¶
type CredentialQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) CredentialQueryInterface
HasWorkflowID() bool
GetWorkflowID() string
WithWorkflowID(workflowID string) CredentialQueryInterface
HasNodeID() bool
GetNodeID() string
WithNodeID(nodeID string) CredentialQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) CredentialQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) CredentialQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) CredentialQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) CredentialQueryInterface
}
CredentialQueryInterface is the fluent query builder for listing and counting credential entities.
func CredentialQuery ¶
func CredentialQuery() CredentialQueryInterface
CredentialQuery creates a new credential query builder
type DeployRecordInterface ¶
type DeployRecordInterface interface {
GetID() string
SetID(id string) DeployRecordInterface
GetWorkflowID() string
SetWorkflowID(workflowID string) DeployRecordInterface
GetActor() string
SetActor(actor string) DeployRecordInterface
// GetFlow returns the deployed flow document as raw JSON.
GetFlow() string
SetFlow(flow string) DeployRecordInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) DeployRecordInterface
}
DeployRecordInterface is one immutable entry in a workflow's deploy history: who deployed (actor) and the exact flow document deployed (flow, raw JSON — credential fields carry sentinel markers, never secrets). The deploy timestamp comes from the entity's created_at — per the GOD ruling no duplicated time attributes exist.
func NewDeployRecord ¶
func NewDeployRecord(workflowID, actor, flow string) DeployRecordInterface
NewDeployRecord creates a new deploy record entity
type DeployRecordQueryInterface ¶
type DeployRecordQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) DeployRecordQueryInterface
HasWorkflowID() bool
GetWorkflowID() string
WithWorkflowID(workflowID string) DeployRecordQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) DeployRecordQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) DeployRecordQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) DeployRecordQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) DeployRecordQueryInterface
}
DeployRecordQueryInterface is the fluent query builder for listing and counting deploy record entities.
func DeployRecordQuery ¶
func DeployRecordQuery() DeployRecordQueryInterface
DeployRecordQuery creates a new deploy record query builder. Deploy history reads newest-first, so DESC is the default here (unlike the other entity queries).
type EdgeInterface ¶
type EdgeInterface interface {
GetID() string
SetID(id string) EdgeInterface
GetWorkflowID() string
SetWorkflowID(workflowID string) EdgeInterface
GetSource() string
SetSource(source string) EdgeInterface
GetSourceKey() string
SetSourceKey(sourceKey string) EdgeInterface
GetTarget() string
SetTarget(target string) EdgeInterface
GetTargetKey() string
SetTargetKey(targetKey string) EdgeInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) EdgeInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) EdgeInterface
}
EdgeInterface is the interface form of flowrunner.Edge — a connection between two nodes. The edge IS an entitystore entity: its entity ID is the edge ID and created/updated timestamps come from the entity.
func NewEdge ¶
func NewEdge(id, source, target string) EdgeInterface
NewEdge creates a new workflow edge. Edge ids are never referenced by other entities (edges resolve via their source/target attributes), so an over-length id is deterministically shortened at the boundary.
type EdgeQueryInterface ¶
type EdgeQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) EdgeQueryInterface
HasWorkflowID() bool
GetWorkflowID() string
WithWorkflowID(workflowID string) EdgeQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) EdgeQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) EdgeQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) EdgeQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) EdgeQueryInterface
}
EdgeQueryInterface is the fluent query builder for listing and counting edge entities.
type EntityCoordinationStore ¶ added in v0.7.0
type EntityCoordinationStore struct {
// contains filtered or unexported fields
}
EntityCoordinationStore is the entitystore-backed distributed coordination store. lastSignalCleanupUnixNano throttles opportunistic cleanup because PollWaiters can run many times per second.
func NewEntityCoordinationStore ¶ added in v0.7.0
func NewEntityCoordinationStore(store entitystore.StoreInterface) *EntityCoordinationStore
NewEntityCoordinationStore builds the coordination store on an existing entitystore StoreInterface.
func (*EntityCoordinationStore) AckWaiter ¶ added in v0.7.0
func (s *EntityCoordinationStore) AckWaiter(ctx context.Context, waiterID, claimToken string) error
AckWaiter deletes the waiter entity, valid only for the current claim owner.
func (*EntityCoordinationStore) IncrementSignal ¶ added in v0.7.0
func (s *EntityCoordinationStore) IncrementSignal(ctx context.Context, key string, metadata map[string]interface{}, ttl time.Duration) error
IncrementSignal atomically increments Key by one inside an entitystore transaction; the count attribute is bumped via CAS so a lost swap aborts and retries the whole operation.
func (*EntityCoordinationStore) NackWaiter ¶ added in v0.7.0
func (s *EntityCoordinationStore) NackWaiter(ctx context.Context, waiterID, claimToken string) error
NackWaiter clears the caller's ownership after a handoff failure so the waiter is retried immediately; the decided outcome and count are preserved.
func (*EntityCoordinationStore) ParkWaiter ¶ added in v0.7.0
func (s *EntityCoordinationStore) ParkWaiter(ctx context.Context, waiter CoordinationWaiter) error
ParkWaiter persists the complete message envelope as a waiter entity.
func (*EntityCoordinationStore) PollWaiters ¶ added in v0.7.0
func (s *EntityCoordinationStore) PollWaiters(ctx context.Context, workflowID, nodeID string) ([]CoordinationWaiter, []CoordinationWaiter, error)
PollWaiters claims expired waiters and releases waiters whose signal count can be consumed, in parked creation order.
func (*EntityCoordinationStore) SetCoordinationClaimTTLForTest ¶ added in v0.7.0
func (s *EntityCoordinationStore) SetCoordinationClaimTTLForTest(ttl time.Duration)
SetCoordinationClaimTTLForTest shortens the ownership lease in focused crash/reclaim tests.
func (*EntityCoordinationStore) Signal ¶ added in v0.7.0
func (s *EntityCoordinationStore) Signal(ctx context.Context, key string) (CoordinationSignal, bool, error)
Signal returns the observable signal state for tests and inspection.
func (*EntityCoordinationStore) Waiters ¶ added in v0.7.0
func (s *EntityCoordinationStore) Waiters(ctx context.Context, workflowID, nodeID string) ([]CoordinationWaiter, error)
Waiters lists parked waiters in creation order for observability.
type EntityInboxStore ¶ added in v0.7.0
type EntityInboxStore struct {
// contains filtered or unexported fields
}
EntityInboxStore is the entitystore-backed durable inbox store. Construct it on the entitystore instance the workflow graph already uses so workflows and their queued messages share one database.
SQLite permits only one writer at a time; writeSetMu serializes this store's SQLite writes (autocommit writes and write-set commits) so a multi-runner drain does not convoy on database locks. Client-server dialects do not use it.
func NewEntityInboxStore ¶ added in v0.7.0
func NewEntityInboxStore(store entitystore.StoreInterface, sqlDB *sql.DB, driver string) *EntityInboxStore
NewEntityInboxStore wraps an entitystore store as the durable inbox backend. sqlDB stays owned by the caller and is used only for the database-clock probe (claim and lease expiry decisions); driver is the neat dialect name ("sqlite", "mysql", "postgres").
func NewEntityInboxStoreFromDB ¶ added in v0.7.0
func NewEntityInboxStoreFromDB(sqlDB *sql.DB) (*EntityInboxStore, error)
NewEntityInboxStoreFromDB builds both the entitystore store and the inbox store on one *sql.DB — the ergonomic constructor for callers that do not already hold a StoreInterface.
func (*EntityInboxStore) ApplyRunLocationOperation ¶ added in v0.15.1
func (s *EntityInboxStore) ApplyRunLocationOperation(ctx context.Context, req RunLocationOperationRequest) (*RunLocationView, error)
ApplyRunLocationOperation performs one atomic operator transition.
func (*EntityInboxStore) BeginInboxWriteSet ¶ added in v0.7.0
func (s *EntityInboxStore) BeginInboxWriteSet(ctx context.Context) (RunInboxWriteSet, error)
BeginInboxWriteSet starts a buffered write-set. The database clock is probed once here so every claim inside the set uses one consistent "now" (and never probes through a possibly single-connection pool).
func (*EntityInboxStore) ClaimInboxItem ¶ added in v0.7.0
func (s *EntityInboxStore) ClaimInboxItem(workflowID, id, runnerID string, ttl time.Duration) (bool, error)
ClaimInboxItem performs one atomic conditional claim. claimed=false means a live claim by another runner — the drainer must skip the row.
func (*EntityInboxStore) DeleteInboxItem ¶ added in v0.7.0
func (s *EntityInboxStore) DeleteInboxItem(workflowID, id string) error
DeleteInboxItem removes one persisted entity (the delivery ack). Legacy inbox entities are deleted; traveller entities transition instead so the journal remains the read model.
func (*EntityInboxStore) DeleteInboxItemAtNode ¶ added in v0.14.0
func (s *EntityInboxStore) DeleteInboxItemAtNode(workflowID, nodeID, id string) error
DeleteInboxItemAtNode is the node-scoped ack used by queue/checkpoint drains. It only removes a pending traveller still located at that node; after release the same traveller may already have moved downstream.
func (*EntityInboxStore) DeleteWorkflowInbox ¶ added in v0.7.0
func (s *EntityInboxStore) DeleteWorkflowInbox(workflowID string) error
DeleteWorkflowInbox drops every queued entity for the workflow; retention cascade-on-delete removes its journal history too.
func (*EntityInboxStore) JournalArrived ¶ added in v0.7.0
func (s *EntityInboxStore) JournalArrived(item *RunInboxItem) error
JournalArrived is the autocommit arrival journal used when an item is persisted outside a write-set (traversal seeds).
func (*EntityInboxStore) JournalOptions ¶ added in v0.7.0
func (s *EntityInboxStore) JournalOptions() JournalOptions
JournalOptions returns the store's current normalized journal config.
func (*EntityInboxStore) JournalReleased ¶ added in v0.7.0
func (s *EntityInboxStore) JournalReleased(workflowID, instanceID, nodeID, runnerID, reason string) error
JournalReleased appends a released event outside any transaction — the release compensation runs after the slice transaction rolled back.
func (*EntityInboxStore) LoadInbox ¶ added in v0.7.0
func (s *EntityInboxStore) LoadInbox(workflowID string) ([]RunInboxItem, error)
LoadInbox returns surviving pending entities and expired claims for the workflow in enqueue order.
func (*EntityInboxStore) LoadInboxFor ¶ added in v0.7.0
func (s *EntityInboxStore) LoadInboxFor(workflowID, runnerID string) ([]RunInboxItem, error)
LoadInboxFor additionally returns rows already claimed by runnerID so a restarting runner requeues its own crash leftovers immediately.
func (*EntityInboxStore) ParkedJournalInstances ¶ added in v0.12.0
func (s *EntityInboxStore) ParkedJournalInstances(ctx context.Context, workflowID string) (map[string][]string, error)
ParkedJournalInstances returns persisted parked input instances grouped by the node where they were parked. Engines use this to recover join lineage after a runner restart; delivery remains inbox-authoritative — this is only the observability map.
func (*EntityInboxStore) ReleaseInboxClaim ¶ added in v0.7.0
func (s *EntityInboxStore) ReleaseInboxClaim(workflowID, id, runnerID string) error
ReleaseInboxClaim reopens a row still owned by runnerID — best-effort compensation after a local write-set rollback; the lease expiry remains the correctness mechanism for real crashes.
func (*EntityInboxStore) RunLocation ¶ added in v0.15.1
func (s *EntityInboxStore) RunLocation(ctx context.Context, workflowID, itemID string) (*RunLocationView, error)
RunLocation returns one authoritative queue location, or nil when the ID is missing, foreign-workflow, or not a queue row.
func (*EntityInboxStore) RunLocationItem ¶ added in v0.15.1
func (s *EntityInboxStore) RunLocationItem(ctx context.Context, workflowID, itemID string) (*RunLocationView, *RunInboxItem, error)
RunLocationItem returns the same location plus the stored delivery envelope. It is for runner/engine use; nodeadmin API responses must expose only the view projection.
func (*EntityInboxStore) RunLocations ¶ added in v0.15.1
func (s *EntityInboxStore) RunLocations(ctx context.Context, workflowID string) ([]RunLocationView, error)
RunLocations lists active, held, failed, and parked durable locations for a workflow in FIFO order. Terminal completed/deleted history remains available through the journal read model rather than this operator queue projection.
func (*EntityInboxStore) SaveInboxItem ¶ added in v0.7.0
func (s *EntityInboxStore) SaveInboxItem(item *RunInboxItem) error
SaveInboxItem persists item and fills in ID and Sequence.
func (*EntityInboxStore) SetJournalOptions ¶ added in v0.7.0
func (s *EntityInboxStore) SetJournalOptions(opts JournalOptions)
SetJournalOptions installs the journal configuration on this store view. Engines use WithJournalOptions for concurrent traversals; this setter remains for the store-level configuration API and is safe for concurrent use.
func (*EntityInboxStore) SetTravellerExecution ¶ added in v0.14.0
func (s *EntityInboxStore) SetTravellerExecution(enabled bool)
SetTravellerExecution flips the Phase-2 cutover switch on this store. New saves become traveller current-location entities immediately; loads, claims and acks stay mixed so legacy inbox entities written before the flip keep draining under the same claim contract.
func (*EntityInboxStore) SweepJournal ¶ added in v0.7.0
func (s *EntityInboxStore) SweepJournal(ctx context.Context) error
SweepJournal deletes one bounded batch of expired journal history: events and edges by entity creation time, and terminal-state instances by the last journal state transition (the entity row is touched on every state transition for this reason).
func (*EntityInboxStore) TravellerExecution ¶ added in v0.14.0
func (s *EntityInboxStore) TravellerExecution() bool
TravellerExecution reports whether this store view uses journal-instance entities as the authoritative queue rows while retaining legacy inbox drain.
func (*EntityInboxStore) WithJournalOptions ¶ added in v0.10.0
func (s *EntityInboxStore) WithJournalOptions(opts JournalOptions) *EntityInboxStore
WithJournalOptions returns a lightweight inbox-store view carrying an immutable copy of opts. The view shares the underlying entitystore, SQL handle, SQLite write serialization, and FIFO enqueue pacing with the base store, but its journal configuration cannot be overwritten by another concurrent traversal or workflow.
func (*EntityInboxStore) WithTravellerExecution ¶ added in v0.14.0
func (s *EntityInboxStore) WithTravellerExecution() *EntityInboxStore
WithTravellerExecution returns a store view whose new saves are traveller current-location entities. Loads, claims and acks remain mixed so legacy inbox entities drain through the same claim contract during cutover.
type EntityLeaseStore ¶ added in v0.7.0
type EntityLeaseStore struct {
// contains filtered or unexported fields
}
EntityLeaseStore is the entitystore-backed lease store. Construct it on the same store (and sqlDB for the clock probe) as the inbox store.
func NewEntityLeaseStore ¶ added in v0.7.0
func NewEntityLeaseStore(store entitystore.StoreInterface, sqlDB *sql.DB) *EntityLeaseStore
NewEntityLeaseStore builds the lease store on an existing entitystore StoreInterface.
func NewEntityLeaseStoreFromDB ¶ added in v0.8.0
func NewEntityLeaseStoreFromDB(sqlDB *sql.DB) (*EntityLeaseStore, error)
NewEntityLeaseStoreFromDB builds both the entitystore store and the lease store on one *sql.DB — the ergonomic constructor for callers that do not already hold a StoreInterface.
func (*EntityLeaseStore) ClaimLease ¶ added in v0.7.0
func (s *EntityLeaseStore) ClaimLease(workflowID, runnerID string, ttl time.Duration) (bool, string, error)
ClaimLease attempts to acquire (or re-acquire) the workflow lease for runnerID. held=false means another live runner owns it; holder then carries that runner's ID.
func (*EntityLeaseStore) ListLeases ¶ added in v0.7.0
func (s *EntityLeaseStore) ListLeases() ([]WorkflowLease, error)
ListLeases returns all workflow leases (expired ones included).
func (*EntityLeaseStore) ListRunners ¶ added in v0.7.0
func (s *EntityLeaseStore) ListRunners() ([]Runner, error)
ListRunners returns all known runners.
func (*EntityLeaseStore) ReleaseLease ¶ added in v0.7.0
func (s *EntityLeaseStore) ReleaseLease(workflowID, runnerID string) error
ReleaseLease drops the lease if (and only if) runnerID owns it.
func (*EntityLeaseStore) RenewLease ¶ added in v0.7.0
RenewLease extends the lease expiry. ok=false means the lease was lost (expired and claimed by another runner, or released).
func (*EntityLeaseStore) UpsertRunner ¶ added in v0.7.0
func (s *EntityLeaseStore) UpsertRunner(r Runner) error
UpsertRunner registers/refreshes a runner heartbeat entity.
type JournalEdgeView ¶ added in v0.13.0
type JournalEdgeView struct {
ID string `json:"id"`
ParentInstanceID string `json:"parent_instance_id"`
ChildInstanceID string `json:"child_instance_id"`
EdgeType string `json:"edge_type"`
Ordinal int64 `json:"ordinal"`
WorkflowID string `json:"workflow_id"`
CreatedAt string `json:"created_at"`
}
JournalEdgeView is one lineage edge between traveller instances.
type JournalEmitted ¶ added in v0.7.0
type JournalEmitted struct {
ToNodeID string
Port string
InstanceID string // clone envelope ID
ParentID string // metadata.parentMsgId
Payload MessageInterface
}
JournalEmitted is one downstream child offered during a slice.
type JournalEventView ¶ added in v0.13.0
type JournalEventView struct {
ID string `json:"id"`
InstanceID string `json:"instance_id"`
RootID string `json:"root_id"`
WorkflowID string `json:"workflow_id"`
EventType string `json:"event_type"`
FromNodeID string `json:"from_node_id"`
ToNodeID string `json:"to_node_id"`
Port string `json:"port"`
RunnerID string `json:"runner_id"`
Operator string `json:"operator"`
Reason string `json:"reason"`
PayloadHash string `json:"payload_hash"`
PayloadSize int64 `json:"payload_size"`
CreatedAt string `json:"created_at"`
}
JournalEventView is one immutable hop/lifecycle event in a traveller instance's timeline. Payload text is deliberately absent.
type JournalInstanceView ¶ added in v0.13.0
type JournalInstanceView struct {
ID string `json:"id"`
WorkflowID string `json:"workflow_id"`
RootID string `json:"root_id"`
ParentInstanceID string `json:"parent_instance_id"`
LocationNodeID string `json:"location_node_id"`
State string `json:"state"`
PayloadHash string `json:"payload_hash"`
PayloadSize int64 `json:"payload_size"`
ClaimOwner string `json:"claim_owner"`
ClaimExpiresAt string `json:"claim_expires_at"`
QueueStatus string `json:"queue_status"`
QueueSequence int64 `json:"queue_sequence"`
QueueEnqueuedAt string `json:"queue_enqueued_at"`
Held bool `json:"held"`
EligibleActions []string `json:"eligible_actions"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
JournalInstanceView is the read-only current-state projection of one traveller instance. Payload text is deliberately absent: inspection exposes hash/size metadata only.
type JournalLineageView ¶ added in v0.13.0
type JournalLineageView struct {
Instance JournalInstanceView `json:"instance"`
Parents []JournalInstanceView `json:"parents"`
Children []JournalInstanceView `json:"children"`
Edges []JournalEdgeView `json:"edges"`
}
JournalLineageView is the selected instance plus its direct parents, direct children, and connecting edges.
type JournalOptions ¶ added in v0.7.0
type JournalOptions struct {
Enabled bool
EventTier string
PayloadTier string
Retention time.Duration
}
JournalOptions controls the observability journal. Enabled is the explicit enable/disable flag. Retention bounds history: SweepJournal deletes entities older than the window; DefaultJournalRetention applies whenever Retention <= 0.
func (JournalOptions) Normalized ¶ added in v0.7.0
func (o JournalOptions) Normalized() JournalOptions
Normalized returns the options with defaults applied.
type JournalSlice ¶ added in v0.7.0
type JournalSlice struct {
WorkflowID string
NodeID string
RunnerID string
InstanceID string // consumed input instance (logical traveller ID)
InputClaimed bool
Emitted []JournalEmitted
Parked []string
InputParked bool
// InputHeld marks queue/checkpoint staging: the consumed traveller stays
// queued at the same node for that node's dedicated drainer instead of
// being completed by the generic traversal.
InputHeld bool
Err string
}
JournalSlice carries the dispatch facts of one processed slice: the consumed input, every emitted downstream child, the slice outcome and any parked (join) inputs the emitted children inherit from.
type MessageInterface ¶
type MessageInterface interface {
GetID() string
SetID(id string) MessageInterface
// GetPayload returns the message payload (typically
// map[string]any or []byte after JSON round-trip)
GetPayload() any
SetPayload(payload any) MessageInterface
// GetMetadata returns the message metadata
GetMetadata() map[string]any
SetMetadata(metadata map[string]any) MessageInterface
// GetError returns the error message if an upstream node failed
GetError() *string
SetError(err string) MessageInterface
ClearError() MessageInterface
// GetTimestamp returns the timestamp when the message was created/last modified
GetTimestamp() time.Time
SetTimestamp(timestamp time.Time) MessageInterface
// GetCreatedAt returns the creation timestamp
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) MessageInterface
// GetUpdatedAt returns the last update timestamp
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) MessageInterface
}
MessageInterface is the interface form of flowrunner.Message — the standardized envelope for data flowing between nodes, persisted as an entity (type EntityTypeMessage) so the runner has durable messages.
type MessageQueryInterface ¶
type MessageQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) MessageQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) MessageQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) MessageQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) MessageQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) MessageQueryInterface
}
MessageQueryInterface is the fluent query builder for listing and counting messages.
func MessageQuery ¶
func MessageQuery() MessageQueryInterface
MessageQuery creates a new message query builder
type NewStoreOptions ¶
type NewStoreOptions struct {
// EntityStore is the underlying storage (required)
EntityStore entitystore.StoreInterface
// DebugEnabled enables debug logging
DebugEnabled bool
// CredentialCipher seals credential values at rest. When nil,
// credentials are stored as plaintext JSON (legacy behavior —
// prefer NewAESCredentialCipher for real secrets).
CredentialCipher CredentialCipher
}
NewStoreOptions define the options for creating a new node store
type NodeGroupInterface ¶
type NodeGroupInterface interface {
GetID() string
SetID(id string) NodeGroupInterface
GetWorkflowID() string
SetWorkflowID(workflowID string) NodeGroupInterface
GetName() string
SetName(name string) NodeGroupInterface
// GetData returns the group's freeform view payload (x, y, w, h,
// disabled, childFlow, env) — the view.groups entry minus id/name/
// nodeIds.
GetData() map[string]any
SetData(data map[string]any) NodeGroupInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) NodeGroupInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) NodeGroupInterface
}
NodeGroupInterface is the entity form of an editor view group (one of the view.groups entries: {id, name, x, y, w, h, disabled, childFlow, nodeIds}). Membership is NOT stored here — it lives as group_id on the member node entities (GOD ruling 2026-11-24); the geometry and flags ride in the data attribute so the wire shape round-trips.
func NewNodeGroup ¶
func NewNodeGroup(workflowID, name string) NodeGroupInterface
NewNodeGroup creates a new node group entity
type NodeGroupQueryInterface ¶
type NodeGroupQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) NodeGroupQueryInterface
HasWorkflowID() bool
GetWorkflowID() string
WithWorkflowID(workflowID string) NodeGroupQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) NodeGroupQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) NodeGroupQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) NodeGroupQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) NodeGroupQueryInterface
}
NodeGroupQueryInterface is the fluent query builder for listing and counting node group entities.
func NodeGroupQuery ¶
func NodeGroupQuery() NodeGroupQueryInterface
NodeGroupQuery creates a new node group query builder
type NodeInterface ¶
type NodeInterface interface {
GetID() string
SetID(id string) NodeInterface
GetWorkflowID() string
SetWorkflowID(workflowID string) NodeInterface
// GetGroupID returns the node_group entity this node belongs to
// ("" = ungrouped) — group membership lives on the node, not on
// the group (GOD ruling 2026-11-24).
GetGroupID() string
SetGroupID(groupID string) NodeInterface
GetType() string
SetType(nodeType string) NodeInterface
GetPositionX() float64
SetPositionX(x float64) NodeInterface
GetPositionY() float64
SetPositionY(y float64) NodeInterface
SetPosition(x, y float64) NodeInterface
GetData() map[string]any
SetData(data map[string]any) NodeInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) NodeInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) NodeInterface
}
NodeInterface is the interface form of flowrunner.Node — a single node in a workflow graph. The node IS an entitystore entity: its entity ID is the node ID and created/updated timestamps come from the entity.
type NodeQueryInterface ¶
type NodeQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) NodeQueryInterface
HasWorkflowID() bool
GetWorkflowID() string
WithWorkflowID(workflowID string) NodeQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) NodeQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) NodeQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) NodeQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) NodeQueryInterface
}
NodeQueryInterface is the fluent query builder for listing and counting node entities.
type RunInboxItem ¶ added in v0.7.0
type RunInboxItem struct {
ID string
WorkflowID string
NodeID string
Sequence int64
Payload MessageInterface
EnqueuedAt time.Time
// contains filtered or unexported fields
}
RunInboxItem is one persisted inbox entity. ID is the entity id (UUIDv7, assigned at save). Sequence is the enqueue's unix milliseconds — the FIFO ordering value LoadInbox sorts by.
type RunInboxWriteSet ¶ added in v0.7.0
type RunInboxWriteSet interface {
SaveInboxItem(item *RunInboxItem) error
ClaimInboxItem(workflowID, id, runnerID string, ttl time.Duration) (bool, error)
ConfirmInboxClaim(workflowID, id, runnerID string, ttl time.Duration) (bool, error)
DeleteInboxItem(workflowID, id string) error
RecordJournalSlice(slice *JournalSlice) error
Commit() error
Rollback() error
}
RunInboxWriteSet is the transaction-scoped write side of one processing slice (noderun's InboxWriteSet contract).
type RunLocationOperationRequest ¶ added in v0.15.1
type RunLocationOperationRequest struct {
WorkflowID string `json:"workflow_id"`
ItemID string `json:"item_id"`
Operation string `json:"operation"`
TargetNodeID string `json:"target_node_id,omitempty"`
Operator string `json:"operator,omitempty"`
Reason string `json:"reason,omitempty"`
}
RunLocationOperationRequest is one operator mutation. ItemID is the durable row identity (legacy inbox entity ID or traveller instance ID).
type RunLocationView ¶ added in v0.15.1
type RunLocationView struct {
ID string `json:"id"`
WorkflowID string `json:"workflow_id"`
NodeID string `json:"node_id"`
Kind string `json:"kind"`
State string `json:"state"`
Status string `json:"status"`
Sequence int64 `json:"sequence"`
EnqueuedAt string `json:"enqueued_at"`
ClaimOwner string `json:"claim_owner"`
ClaimExpiresAt string `json:"claim_expires_at"`
PayloadHash string `json:"payload_hash"`
PayloadSize int64 `json:"payload_size"`
Held bool `json:"held"`
EligibleActions []string `json:"eligible_actions"`
UpdatedAt string `json:"updated_at"`
}
RunLocationView is the operator-facing projection of one durable queue location. Payload text is intentionally absent.
type RunStores ¶ added in v0.7.0
type RunStores struct {
Inbox *EntityInboxStore
Leases *EntityLeaseStore
Coordination *EntityCoordinationStore
}
RunStores bundles the three noderun durable stores sharing one entitystore instance — the wiring nodeadmin and runners should use: one entity DB, one entitystore store, three consumers' views.
func NewRunStores ¶ added in v0.7.0
func NewRunStores(st entitystore.StoreInterface, sqlDB *sql.DB) (*RunStores, error)
NewRunStores builds the three durable stores on an existing entitystore StoreInterface.
type Runner ¶ added in v0.7.0
type Runner struct {
RunnerID string
Hostname string
Version string
LastSeen time.Time
RunningCount int
}
Runner is one registered runner heartbeat row.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the nodestore implementation backed by an entity store
func NewStore ¶
func NewStore(opts NewStoreOptions) (*Store, error)
NewStore creates a new node store on top of an entity store
func (*Store) ConfigGet ¶
ConfigGet returns the raw value stored under a config key, or the empty string when the key does not exist.
func (*Store) ContextValueDelete ¶ added in v0.5.0
ContextValueDelete removes one key. A missing key is not an error.
func (*Store) ContextValueDeleteByWorkflowID ¶ added in v0.5.0
ContextValueDeleteByWorkflowID removes every context value owned by a workflow. Global/unowned values have an empty workflow owner and are deliberately preserved.
func (*Store) ContextValueDeleteScope ¶ added in v0.5.0
ContextValueDeleteScope removes every key in one scope bucket.
func (*Store) ContextValueGet ¶ added in v0.5.0
func (st *Store) ContextValueGet(ctx context.Context, scope, scopeID, key string) (string, bool, error)
ContextValueGet returns the serialized value stored under key in a scope bucket. ok is false when the key has never been set.
func (*Store) ContextValueKeys ¶ added in v0.5.0
ContextValueKeys lists keys in one scope bucket, sorted for deterministic runtime behavior.
func (*Store) ContextValueSet ¶ added in v0.5.0
func (st *Store) ContextValueSet(ctx context.Context, workflowID, scope, scopeID, key, value string) error
ContextValueSet upserts one serialized value. workflowID is stored as ownership metadata for cascade deletion; it is empty for values not owned by a workflow (notably global context).
func (*Store) CredentialCount ¶
func (*Store) CredentialCreate ¶
func (st *Store) CredentialCreate(ctx context.Context, credential CredentialInterface) error
func (*Store) CredentialDeleteByID ¶
func (*Store) CredentialDeleteByWorkflowID ¶
CredentialDeleteByWorkflowID drops every credential entity owned by the workflow (called when the workflow is deleted).
func (*Store) CredentialFindByID ¶
func (*Store) CredentialFindByNode ¶
func (st *Store) CredentialFindByNode(ctx context.Context, workflowID, nodeID string) (CredentialInterface, error)
CredentialFindByNode returns the single credential entity for a (workflow, node) pair, or nil when none is stored.
func (*Store) CredentialList ¶
func (st *Store) CredentialList(ctx context.Context, query CredentialQueryInterface) ([]CredentialInterface, error)
CredentialList lists credential entities. WithWorkflowID uses EntityListByAttribute (the single attribute-value lookup the store offers — see NodeList); node filtering, limit/offset and sort are applied in memory.
func (*Store) CredentialMapForWorkflow ¶
func (st *Store) CredentialMapForWorkflow(ctx context.Context, workflowID string) (map[string]map[string]string, error)
CredentialMapForWorkflow returns the workflow's stored credentials in the deploy-time shape nodeID → key → value — the single read the engine's credential provider needs.
func (*Store) CredentialReplaceForWorkflow ¶
func (st *Store) CredentialReplaceForWorkflow(ctx context.Context, workflowID string, creds map[string]map[string]string) error
CredentialReplaceForWorkflow bulk-replaces a workflow's credential entities from a nodeID → key → value map: entities not present in the map are deleted, changed ones updated, new ones created. Used by the workflow save path after extractWorkflowCredentials moves the secrets out of node.Data.
func (*Store) CredentialUpdate ¶
func (st *Store) CredentialUpdate(ctx context.Context, credential CredentialInterface) error
func (*Store) DeployRecordCount ¶
func (*Store) DeployRecordCreate ¶
func (st *Store) DeployRecordCreate(ctx context.Context, record DeployRecordInterface) error
DeployRecordCreate appends an immutable deploy record and prunes the workflow's history beyond DeployRecordRetention (oldest first — deploy records are append-only, never updated, so there is no DeployRecordUpdate on the contract).
func (*Store) DeployRecordDeleteByID ¶
func (*Store) DeployRecordDeleteByWorkflowID ¶
DeployRecordDeleteByWorkflowID drops the workflow's whole deploy history (called when the workflow is deleted).
func (*Store) DeployRecordFindByID ¶
func (*Store) DeployRecordList ¶
func (st *Store) DeployRecordList(ctx context.Context, query DeployRecordQueryInterface) ([]DeployRecordInterface, error)
DeployRecordList lists deploy record entities; WithWorkflowID uses EntityListByAttribute like the other per-workflow listings. Sort order applies to the entity created_at (the deploy timestamp).
func (*Store) EdgeCreate ¶
func (st *Store) EdgeCreate(ctx context.Context, edge EdgeInterface) error
func (*Store) EdgeDeleteByID ¶
func (*Store) EdgeFindByID ¶
func (*Store) EdgeList ¶
func (st *Store) EdgeList(ctx context.Context, query EdgeQueryInterface) ([]EdgeInterface, error)
EdgeList mirrors NodeList — WithWorkflowID goes through EntityListByAttribute (entities×attributes JOIN on workflow_id).
func (*Store) EdgeUpdate ¶
func (st *Store) EdgeUpdate(ctx context.Context, edge EdgeInterface) error
func (*Store) EnableDebug ¶
func (st *Store) EnableDebug(debugEnabled bool) StoreInterface
func (*Store) GetEntityStore ¶
func (st *Store) GetEntityStore() entitystore.StoreInterface
func (*Store) JournalInstance ¶ added in v0.13.0
func (st *Store) JournalInstance(ctx context.Context, workflowID, instanceID string) (*JournalInstanceView, error)
JournalInstance returns one traveller instance when it belongs to the workflow. A missing or cross-workflow ID returns nil, nil.
func (*Store) JournalInstances ¶ added in v0.13.0
func (st *Store) JournalInstances(ctx context.Context, workflowID string) ([]JournalInstanceView, error)
JournalInstances returns current traveller-instance state for one workflow, grouped readably by node location, state, then instance ID.
func (*Store) JournalLineage ¶ added in v0.13.0
func (st *Store) JournalLineage(ctx context.Context, workflowID, instanceID string) (*JournalLineageView, error)
JournalLineage returns the direct parent/child family around one traveller instance. Edges remain included even when a related instance has already aged out of the current-state table.
func (*Store) JournalTimeline ¶ added in v0.13.0
func (st *Store) JournalTimeline(ctx context.Context, workflowID, instanceID string) ([]JournalEventView, error)
JournalTimeline returns one instance's travel events oldest-first. The instance is validated against the workflow so a cross-workflow ID reports no rows rather than leaking another workflow's history.
func (*Store) MessageCount ¶
func (*Store) MessageCreate ¶
func (st *Store) MessageCreate(ctx context.Context, message MessageInterface) error
func (*Store) MessageDeleteByID ¶
func (*Store) MessageFindByID ¶
func (*Store) MessageList ¶
func (st *Store) MessageList(ctx context.Context, query MessageQueryInterface) ([]MessageInterface, error)
func (*Store) MessageUpdate ¶
func (st *Store) MessageUpdate(ctx context.Context, message MessageInterface) error
func (*Store) MigrateViewGroups ¶
MigrateViewGroups converts each workflow's view.groups array into node_group entities and stamps group_id on the member node entities. Once converted, the "groups" key is stripped from the stored view attribute — since P5 the node_group entities are the authoritative read path (loadWorkflowGroups re-synthesizes the wire shape), so a lingering blob could only go stale. Returns the number of node groups upserted. Idempotent: group entities keep the entry ID, memberships are rewritten, and re-runs see a view attribute with no "groups" key.
func (*Store) MigrateWorkflowBlobAttributes ¶
MigrateWorkflowBlobAttributes is a one-shot migration for pre-change nodestore.db files: workflows that still carry the legacy ATTRIBUTE_NODES/ATTRIBUTE_EDGES JSON blobs get real node/edge child entities created (entity type node/edge, workflow_id link), and the blob attributes are removed afterwards.
It is idempotent — workflows already migrated have no blob keys and are skipped (children loaded by loadWorkflowChildren take precedence anyway). Callers invoke it explicitly, e.g. once at startup:
migrated, err := store.MigrateWorkflowBlobAttributes(ctx)
Returns the number of workflows migrated.
func (*Store) MigrateWorkflowGroupsConfig ¶
MigrateWorkflowGroupsConfig converts the "workflowGroups" section of the named config blob into workflow_group entities, then removes the section so the config store no longer carries structured domain data. Returns the number of groups upserted. Idempotent: groups are keyed by their original ID and updated in place on re-run.
func (*Store) NodeCreate ¶
func (st *Store) NodeCreate(ctx context.Context, node NodeInterface) error
func (*Store) NodeDeleteByID ¶
func (*Store) NodeFindByID ¶
func (*Store) NodeGroupCount ¶
func (*Store) NodeGroupCreate ¶
func (st *Store) NodeGroupCreate(ctx context.Context, group NodeGroupInterface) error
func (*Store) NodeGroupDeleteByID ¶
func (*Store) NodeGroupFindByID ¶
func (*Store) NodeGroupList ¶
func (st *Store) NodeGroupList(ctx context.Context, query NodeGroupQueryInterface) ([]NodeGroupInterface, error)
func (*Store) NodeGroupUpdate ¶
func (st *Store) NodeGroupUpdate(ctx context.Context, group NodeGroupInterface) error
func (*Store) NodeList ¶
func (st *Store) NodeList(ctx context.Context, query NodeQueryInterface) ([]NodeInterface, error)
NodeList lists node entities. WithWorkflowID uses entitystore.EntityListByAttribute — a single entities×attributes JOIN on entity type + workflow_id attribute (AttributeQuery has no value filter, so this is the only attribute-value lookup the store offers). Limit/offset/sort are applied in memory, consistent with WorkflowList.
func (*Store) NodeUpdate ¶
func (st *Store) NodeUpdate(ctx context.Context, node NodeInterface) error
func (*Store) WorkflowCount ¶
func (*Store) WorkflowCreate ¶
func (st *Store) WorkflowCreate(ctx context.Context, workflow WorkflowInterface) error
func (*Store) WorkflowDeleteByID ¶
WorkflowDeleteByID deletes the workflow AND its child node/edge entities plus workflow-owned runtime context (cascade — documented behavior; children and owned state are never orphaned). Context values with no workflow owner, including global context, are preserved.
func (*Store) WorkflowFindByID ¶
func (*Store) WorkflowFindByName ¶
func (*Store) WorkflowGroupCount ¶
func (*Store) WorkflowGroupCreate ¶
func (st *Store) WorkflowGroupCreate(ctx context.Context, group WorkflowGroupInterface) error
func (*Store) WorkflowGroupDeleteByID ¶
func (*Store) WorkflowGroupFindByID ¶
func (*Store) WorkflowGroupList ¶
func (st *Store) WorkflowGroupList(ctx context.Context, query WorkflowGroupQueryInterface) ([]WorkflowGroupInterface, error)
func (*Store) WorkflowGroupUpdate ¶
func (st *Store) WorkflowGroupUpdate(ctx context.Context, group WorkflowGroupInterface) error
func (*Store) WorkflowList ¶
func (st *Store) WorkflowList(ctx context.Context, query WorkflowQueryInterface) ([]WorkflowInterface, error)
WorkflowList lists workflows. entitystore can only filter on entity columns (type/handle/dates), so attribute criteria are applied in memory, then offset/limit. Children (nodes/edges) are loaded eagerly per workflow — see workflowFromEntity.
func (*Store) WorkflowTrashByID ¶
WorkflowTrashByID soft-deletes a workflow into the entitystore trash (children are left in place — restore semantics, same as before)
func (*Store) WorkflowUpdate ¶
func (st *Store) WorkflowUpdate(ctx context.Context, workflow WorkflowInterface) error
type StoreInterface ¶
type StoreInterface interface {
// GetEntityStore returns the underlying entity store
GetEntityStore() entitystore.StoreInterface
// EnableDebug enables debug mode
EnableDebug(debugEnabled bool) StoreInterface
WorkflowCount(ctx context.Context, query WorkflowQueryInterface) (int64, error)
WorkflowCreate(ctx context.Context, workflow WorkflowInterface) error
WorkflowDeleteByID(ctx context.Context, id string) error
WorkflowFindByID(ctx context.Context, id string) (WorkflowInterface, error)
WorkflowFindByName(ctx context.Context, name string) (WorkflowInterface, error)
WorkflowList(ctx context.Context, query WorkflowQueryInterface) ([]WorkflowInterface, error)
WorkflowTrashByID(ctx context.Context, id string) error
WorkflowUpdate(ctx context.Context, workflow WorkflowInterface) error
NodeCount(ctx context.Context, query NodeQueryInterface) (int64, error)
NodeCreate(ctx context.Context, node NodeInterface) error
NodeDeleteByID(ctx context.Context, id string) error
NodeFindByID(ctx context.Context, id string) (NodeInterface, error)
NodeList(ctx context.Context, query NodeQueryInterface) ([]NodeInterface, error)
NodeUpdate(ctx context.Context, node NodeInterface) error
EdgeCount(ctx context.Context, query EdgeQueryInterface) (int64, error)
EdgeCreate(ctx context.Context, edge EdgeInterface) error
EdgeDeleteByID(ctx context.Context, id string) error
EdgeFindByID(ctx context.Context, id string) (EdgeInterface, error)
EdgeList(ctx context.Context, query EdgeQueryInterface) ([]EdgeInterface, error)
EdgeUpdate(ctx context.Context, edge EdgeInterface) error
MessageCount(ctx context.Context, query MessageQueryInterface) (int64, error)
MessageCreate(ctx context.Context, message MessageInterface) error
MessageDeleteByID(ctx context.Context, id string) error
MessageFindByID(ctx context.Context, id string) (MessageInterface, error)
MessageList(ctx context.Context, query MessageQueryInterface) ([]MessageInterface, error)
MessageUpdate(ctx context.Context, message MessageInterface) error
CredentialCount(ctx context.Context, query CredentialQueryInterface) (int64, error)
CredentialCreate(ctx context.Context, credential CredentialInterface) error
CredentialDeleteByID(ctx context.Context, id string) error
CredentialDeleteByWorkflowID(ctx context.Context, workflowID string) error
CredentialFindByID(ctx context.Context, id string) (CredentialInterface, error)
CredentialFindByNode(ctx context.Context, workflowID, nodeID string) (CredentialInterface, error)
CredentialList(ctx context.Context, query CredentialQueryInterface) ([]CredentialInterface, error)
CredentialUpdate(ctx context.Context, credential CredentialInterface) error
// CredentialMapForWorkflow returns nodeID → key → value — the
// deploy-time credential injection map.
CredentialMapForWorkflow(ctx context.Context, workflowID string) (map[string]map[string]string, error)
// CredentialReplaceForWorkflow bulk-replaces a workflow's stored
// credentials (save path, after extraction).
CredentialReplaceForWorkflow(ctx context.Context, workflowID string, creds map[string]map[string]string) error
DeployRecordCount(ctx context.Context, query DeployRecordQueryInterface) (int64, error)
// DeployRecordCreate appends an immutable record and prunes the
// workflow's history beyond DeployRecordRetention.
DeployRecordCreate(ctx context.Context, record DeployRecordInterface) error
DeployRecordDeleteByID(ctx context.Context, id string) error
DeployRecordDeleteByWorkflowID(ctx context.Context, workflowID string) error
DeployRecordFindByID(ctx context.Context, id string) (DeployRecordInterface, error)
DeployRecordList(ctx context.Context, query DeployRecordQueryInterface) ([]DeployRecordInterface, error)
NodeGroupCount(ctx context.Context, query NodeGroupQueryInterface) (int64, error)
NodeGroupCreate(ctx context.Context, group NodeGroupInterface) error
NodeGroupDeleteByID(ctx context.Context, id string) error
NodeGroupFindByID(ctx context.Context, id string) (NodeGroupInterface, error)
NodeGroupList(ctx context.Context, query NodeGroupQueryInterface) ([]NodeGroupInterface, error)
NodeGroupUpdate(ctx context.Context, group NodeGroupInterface) error
WorkflowGroupCount(ctx context.Context, query WorkflowGroupQueryInterface) (int64, error)
WorkflowGroupCreate(ctx context.Context, group WorkflowGroupInterface) error
WorkflowGroupDeleteByID(ctx context.Context, id string) error
WorkflowGroupFindByID(ctx context.Context, id string) (WorkflowGroupInterface, error)
WorkflowGroupList(ctx context.Context, query WorkflowGroupQueryInterface) ([]WorkflowGroupInterface, error)
WorkflowGroupUpdate(ctx context.Context, group WorkflowGroupInterface) error
ConfigGet(ctx context.Context, key string) (string, error)
ConfigSet(ctx context.Context, key string, value string) error
}
StoreInterface is the nodestore contract — entitystore-backed persistence for the flowrunner domain: workflows (with nodes and edges) and messages.
type WorkflowGroupInterface ¶
type WorkflowGroupInterface interface {
GetID() string
SetID(id string) WorkflowGroupInterface
GetName() string
SetName(name string) WorkflowGroupInterface
// GetParentID returns the parent group ID ("" = top level).
GetParentID() string
SetParentID(parentID string) WorkflowGroupInterface
// GetWorkflowIDs returns the member workflow IDs.
GetWorkflowIDs() []string
SetWorkflowIDs(ids []string) WorkflowGroupInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) WorkflowGroupInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) WorkflowGroupInterface
}
WorkflowGroupInterface is the entity form of a sidebar workflow grouping entry — previously the global-config "workflowGroups" JSON section shaped {id, name, parentId, workflows:[id]}. Members are the workflow IDs listed in the group.
func NewWorkflowGroup ¶
func NewWorkflowGroup(name string) WorkflowGroupInterface
NewWorkflowGroup creates a new workflow group entity
type WorkflowGroupQueryInterface ¶
type WorkflowGroupQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) WorkflowGroupQueryInterface
HasParentID() bool
GetParentID() string
WithParentID(parentID string) WorkflowGroupQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) WorkflowGroupQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) WorkflowGroupQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) WorkflowGroupQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) WorkflowGroupQueryInterface
}
WorkflowGroupQueryInterface is the fluent query builder for listing and counting workflow group entities.
func WorkflowGroupQuery ¶
func WorkflowGroupQuery() WorkflowGroupQueryInterface
WorkflowGroupQuery creates a new workflow group query builder
type WorkflowInterface ¶
type WorkflowInterface interface {
GetID() string
SetID(id string) WorkflowInterface
GetName() string
SetName(name string) WorkflowInterface
GetDescription() string
SetDescription(description string) WorkflowInterface
GetNodes() []NodeInterface
SetNodes(nodes []NodeInterface) WorkflowInterface
AddNode(node NodeInterface) WorkflowInterface
FindNodeByID(id string) NodeInterface
GetEdges() []EdgeInterface
SetEdges(edges []EdgeInterface) WorkflowInterface
AddEdge(edge EdgeInterface) WorkflowInterface
GetView() map[string]any
SetView(view map[string]any) WorkflowInterface
GetDeployed() bool
SetDeployed(deployed bool) WorkflowInterface
GetPaused() bool
SetPaused(paused bool) WorkflowInterface
GetCreatedAt() time.Time
SetCreatedAt(createdAt time.Time) WorkflowInterface
GetUpdatedAt() time.Time
SetUpdatedAt(updatedAt time.Time) WorkflowInterface
}
WorkflowInterface is the interface form of flowrunner.Workflow — a complete workflow definition persisted in the entity store.
func DeepCloneWorkflow ¶
func DeepCloneWorkflow(w WorkflowInterface) WorkflowInterface
DeepCloneWorkflow returns a workflow carrying fresh node objects with deep-copied data maps (JSON round-trip — node data is always JSON-typed). The deploy path clones before credential injection so real secrets never land in the caller's stored document — the engine's own cloneWorkflow is shallow (nodes shared).
func ImportNodeRED ¶
func ImportNodeRED(data []byte) (WorkflowInterface, error)
ImportNodeRED converts a Node-RED flow JSON array into a workflow. Regular nodes keep their config keys verbatim in Data (engine node configs use the Node-RED field names); tab membership becomes Data["childFlow"]; wires become edges. Node-RED subflow definitions and their internal nodes fold into a single type:"component" node.
func NewWorkflow ¶
func NewWorkflow(name string) WorkflowInterface
NewWorkflow creates a new workflow
type WorkflowLease ¶ added in v0.7.0
type WorkflowLease struct {
WorkflowID string
RunnerID string
ExpiresAt time.Time
Generation int64
}
WorkflowLease is one persisted workflow lease.
type WorkflowQueryInterface ¶
type WorkflowQueryInterface interface {
Validate() error
HasID() bool
GetID() string
WithID(id string) WorkflowQueryInterface
HasName() bool
GetName() string
WithName(name string) WorkflowQueryInterface
HasDeployed() bool
GetDeployed() bool
WithDeployed(deployed bool) WorkflowQueryInterface
HasPaused() bool
GetPaused() bool
WithPaused(paused bool) WorkflowQueryInterface
HasLimit() bool
GetLimit() uint64
WithLimit(limit uint64) WorkflowQueryInterface
HasOffset() bool
GetOffset() uint64
WithOffset(offset uint64) WorkflowQueryInterface
GetSortOrder() string
WithSortOrder(sortOrder string) WorkflowQueryInterface
IsCountOnly() bool
WithCountOnly(countOnly bool) WorkflowQueryInterface
}
WorkflowQueryInterface is the fluent query builder for listing and counting workflows.
func WorkflowQuery ¶
func WorkflowQuery() WorkflowQueryInterface
WorkflowQuery creates a new workflow query builder
Source Files
¶
- childflow_exchange.go
- component.go
- constants.go
- credential.go
- credential_cipher.go
- credential_query.go
- credentials.go
- deploy_record.go
- deploy_record_query.go
- dot.go
- edge.go
- edge_query.go
- functions.go
- message.go
- message_query.go
- node.go
- node_group.go
- node_group_query.go
- node_query.go
- nodered.go
- noderun_clock.go
- noderun_coordination.go
- noderun_inbox.go
- noderun_inbox_writeset.go
- noderun_journal.go
- noderun_journal_read.go
- noderun_leases.go
- noderun_location_ops.go
- store.go
- store_config.go
- store_context_value.go
- store_credential.go
- store_deploy_record.go
- store_edge.go
- store_message.go
- store_migrate.go
- store_migrate_groups.go
- store_node.go
- store_node_group.go
- store_workflow.go
- store_workflow_group.go
- store_workflow_groups.go
- terminology_migration.go
- workflow.go
- workflow_group.go
- workflow_group_query.go
- workflow_query.go