Skip to content

Execution context from Maestro on tasks and in handlers (4.5.0) — step 1 - #231

Draft
andrejsimic wants to merge 1 commit into
masterfrom
feat/master/maestro-nats
Draft

andrejsimic wants to merge 1 commit into
masterfrom
feat/master/maestro-nats

Conversation

@andrejsimic

@andrejsimic andrejsimic commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Step 1 only. Part of moving CxReports Jobs onto a shared Maestro over NATS. This adds what ConductorSharp needs on its side; Maestro does not send a context yet (that is step 2).

  • Task, Workflow and StartWorkflowRequest get an optional context map, in a partial outside the generated models. It is left out of a start request when null, so a start against Conductor is unchanged.
  • ConductorSharpExecutionContext.Context gives a handler the polled task's context, read-only. Empty against Conductor.
  • Both execution managers treat a null poll response as "no task". Maestro's in-process transport answers an empty poll with null, which surfaced as an unobserved NullReferenceException.

4.5.0: new public API. Not published; the CxReports draft consumes it as 4.5.0-maestro-nats.1 from a local feed.

Tests: 79 pass, 6 new in ExecutionContextTests. The null-poll test pins the behaviour but cannot catch its loss, because the old failure was silent.

Related: codaxy/cx-maestro#185 (the NATS API and the ConductorSharp NATS transport), codaxy/cx-reports#1279 (Jobs on Maestro over NATS, the consumer).

Maestro can start a workflow run with an execution context: key/value pairs such as the tenant
and user the run is for. It keeps them unchanged for the life of the run, gives them to
sub-workflows, and sends them with every polled task.

- Task, Workflow and StartWorkflowRequest get an optional Context, in a partial outside the
  generated models. It is left out of a start request when null, so a start against Conductor
  is unchanged.
- ConductorSharpExecutionContext.Context gives a handler the polled task's context, as a
  read-only copy. It is empty against Conductor.
- Both execution managers treat a null poll response as "no task". Maestro's in-process
  transport answers an empty poll with null rather than a 204, which surfaced as an unobserved
  NullReferenceException in the poll.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant