fix(workflow-executor): accept triggerType='mcp' in run mapper (PRD-832) - #1786
Merged
christophebrun-forest merged 1 commit intoJul 28, 2026
Conversation
MCP-triggered runs carry triggerType='mcp', but the executor only recognized manual|webhook, so AvailableStepExecutionSchema.parse rejected every MCP run at step 0 with a DomainValidationError before executing. triggerType is informational only (logged in runner.ts, no logic branches on it), so a run was aborted purely over an unrecognized logged value. Add 'mcp' to TriggerType and ServerWorkflowTriggerType so MCP runs map to a valid AvailableStepExecution and execute. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Coverage Impact Unable to calculate total coverage change because base branch coverage was not found. Modified Files with Diff Coverage (2)
🛟 Help
|
christophebrun-forest
merged commit Jul 28, 2026
a5cd3a4
into
feature/prd-49-expose-workflow-tools-in-forest-mcp-server
65 of 66 checks passed
christophebrun-forest
deleted the
feature/prd-832-executor-accept-triggertype-mcp
branch
July 28, 2026 09:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Foundational fix for MCP workflow triggering (epic PRD-49).
A workflow run triggered via MCP carries
triggerType='mcp', but@forestadmin/workflow-executoronly recognizedmanual | webhook. The run mapper validates the value againstAvailableStepExecutionSchema, so every MCP-triggered run failed at step 0 before executing:Surfaced in the Forest UI as:
Root cause
triggerTypeis informational only in the executor — its sole consumer is a Debug log context inrunner.ts; no execution logic branches on it. The run was aborted purely because of an unrecognized value in a logged field.Fix
TriggerType(src/types/validated/execution.ts) — addMcp = 'mcp'ServerWorkflowTriggerType(src/adapters/server-types.ts) — addmcp = 'mcp'Strict-enum approach, consistent with the executor's convention of mirroring the server contract. Unknown trigger types still fail loudly.
Tests
Added a mapper test asserting an
mcp-triggered run maps to a validAvailableStepExecutionwithtriggerTypepreserved (no downgrade tomanual). Full suite green (1469 passed), lint clean.Notes
triggerTypeis only logged, a drift-tolerant passthrough could avoid breaking on future server trigger types (scheduled,api, …).fixes PRD-832
🤖 Generated with Claude Code
Note
Accept
triggerType='mcp'in workflow executor run mapperAdds
mcpas a valid trigger type across the workflow executor by addingMcp = 'mcp'to theTriggerTypeenum in execution.ts andmcptoServerWorkflowTriggerTypein server-types.ts. The run-to-available-step mapper now correctly mapsServerWorkflowTriggerType.mcptoTriggerType.Mcp, covered by a new test case.Macroscope summarized 249bbb9.