Files
bradyyie 0da7d51136 feat(events): add start_agent event handler action
Adds a first-class "Start Agent" action to event handlers, alongside the
existing start_workflow/complete_task/fail_task/terminate_workflow/
update_workflow_variables. This starts a registered agent execution (via the
core WorkflowExecutor.startAgentExecution(AgentStartRequest), already
available on origin/main) directly from an event, without going through
start_workflow against an agent's underlying workflow definition — which
would bypass the agent input contract (prompt/media/context/session_id),
per-run model/timeout overrides, and idempotency handling that
startAgentExecution provides.

Java (common, core):
- EventHandler.Action.Type += start_agent; new flat Action.StartAgent payload
  (name, version, prompt, sessionId, media, context, idempotencyKey) as
  @ProtoField(id = 8) — kept flat rather than reusing AgentStartRequest to
  keep proto generation simple.
- SimpleActionProcessor: new case templating the payload's fields against
  the event via ParametersUtils (mirroring the existing startWorkflow
  handler), then calling workflowExecutor.startAgentExecution(...). No SPI
  needed — WorkflowExecutor and AgentStartRequest are both already visible
  from core.
- grpc/AbstractProtoMapper.java and grpc/eventhandler.proto are regenerated
  by the :conductor-common:protogen task (wired into :conductor-grpc's
  build) — no hand-written gRPC code.

ui-next:
- Action enum + actionLabel ("Start Agent"), persistNewAction, the
  START_AGENT_ACTION schema template, the EventHandlerForm render switch, and
  the StartAgentAction TS type all follow the existing start_workflow
  pattern.
- New StartAgentActionForm (ActionForms/StartAgentTask.tsx), modeled on
  StartWorkflowActionForm: agent name/version pickers sourced from the
  existing /agent/list endpoint and AgentSummary type (already used by
  AgentTaskForm for the same purpose), prompt/session/idempotency-key text
  fields, a newline-delimited media list, and a context key-value editor.

Tests: TestSimpleActionProcessor#testStartAgent (core) and
StartAgentTask.test.tsx (ui-next) cover payload templating/mapping and the
form's field wiring, respectively.

Note: this action is OSS + ui-next only in this change. It requires a mirror
in orkes-conductor (its own EventHandler model + OrkesActionProcessor case)
to work on Orkes, tracked separately.
2026-07-30 16:03:04 -04:00
..