The metadata provider used to create step entities.
The acting user (steps are owned + audited by them).
The parent MJ: AI Agent Runs id every child step belongs to.
The parent step (the goal's step) every child step nests under via ParentID.
Creates a Running child Prompt step for a prompt about to execute, linked to its definition via
TargetID and nested under the goal's parent step via ParentID. The "started" INSERT is
fire-and-forget (queued, not awaited — the PK is client-generated by NewRecord() so the returned
step's id is valid immediately). Returns the step to finalize later, or null if entity creation threw
(step tracking is best-effort and never aborts the goal).
The prompt definition about to run.
The step entity (its INSERT in flight), or null on failure.
Finalizes a child step with its prompt-run id (TargetLogID) and outcome. The UPDATE is queued
fire-and-forget (chained after the step's INSERT, force-persisted). A no-op when step is null
(creation had failed).
The step returned by BeginPromptStep (or null).
The produced AIPromptRun id, when known.
Whether the prompt succeeded.
OptionalerrorMessage: stringOptional failure detail.
Awaits every queued step save (INSERT + finalize UPDATE). Call once the goal completes so the nested prompt steps are durably persisted before the run returns. Failures are logged, never thrown.
Seeds the step-number counter from the run's current step count so child steps continue the run's sequence (best-effort; a query failure just starts numbering from the goal's first prompt).
Creates and finalizes child
Promptsteps under a parent agent-run step for the prompts a Computer Use goal executes. Constructed only when the run is linked to a parent step (agent run id + parent step id); absent that linkage the engine skips step tracking entirely.