Description
When emitting events using the emit task, the SDK requires the source property to be set. If not provided, validation fails with an error.
Per the specification (PR #1175, Issue #1174), the source property should be optional — it can be auto-generated by runtime implementations (e.g., from the workflow identity /{namespace}/{name}/{version}) at emission time. When explicitly provided by the workflow author, the supplied value takes precedence over the auto-generated one.
Root Cause
The specification schema (workflow.yaml) has required: [ source, type ] in the emitTask definition's with property. This has been fixed to required: [ type ] in specification PR #1175.
Once the spec change is merged and a new schema version is released, running npm run codegen will regenerate the TypeScript types and make source optional in EmitEventWith.
Expected Behavior
Users should be able to emit events without specifying source:
emit:
event:
with:
type: com.example.my-event
data: ${ .result }
The runtime should auto-generate source (e.g., from the workflow identity).
Actual Behavior
Validation fails because source is marked as required in the generated TypeScript types (EmitEventWith.source: EventSource instead of EmitEventWith.source?: EventSource).
Resolution
Blocked on specification PR #1175. Once merged, regenerate SDK types with npm run codegen.
Description
When emitting events using the
emittask, the SDK requires thesourceproperty to be set. If not provided, validation fails with an error.Per the specification (PR #1175, Issue #1174), the
sourceproperty should be optional — it can be auto-generated by runtime implementations (e.g., from the workflow identity/{namespace}/{name}/{version}) at emission time. When explicitly provided by the workflow author, the supplied value takes precedence over the auto-generated one.Root Cause
The specification schema (
workflow.yaml) hasrequired: [ source, type ]in theemitTaskdefinition'swithproperty. This has been fixed torequired: [ type ]in specification PR #1175.Once the spec change is merged and a new schema version is released, running
npm run codegenwill regenerate the TypeScript types and makesourceoptional inEmitEventWith.Expected Behavior
Users should be able to emit events without specifying
source:The runtime should auto-generate
source(e.g., from the workflow identity).Actual Behavior
Validation fails because
sourceis marked as required in the generated TypeScript types (EmitEventWith.source: EventSourceinstead ofEmitEventWith.source?: EventSource).Resolution
Blocked on specification PR #1175. Once merged, regenerate SDK types with
npm run codegen.