feat(extensibility): migrate n8n hook execution to per-workflow MCP tool invocation - #324
Open
rishikunnath2747 wants to merge 6 commits into
Open
feat(extensibility): migrate n8n hook execution to per-workflow MCP tool invocation#324rishikunnath2747 wants to merge 6 commits into
rishikunnath2747 wants to merge 6 commits into
Conversation
This commit adds the changes to migrate the extensibility module to support the new n8n architecture
This reverts commit 791d45f.
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
Migrates n8n hook execution in the extensibility module from a workflow-ID-based polling model (using instance mcp) to a per-workflow MCP tool invocation model.
What changed:
N8nWorkflowConfigdataclass:workflow_idfield removed; replaced withord_id,card_ord_id,tool_name, andglobal_tenant_idworkflowId_build_hook()now skips hooks missing eithertoolNameorcardOrdId(previously guarded onworkflowId)_discover_n8n_tools()now filters discovered MCP tools by bothtool_nameandcard_ord_id(each hook is its own MCP server)_execute_workflow_via_agw()rewritten: singlecall_mcp_tool()call; response is expected to be an A2AMessagereturned directly (no polling, no execution-tree traversal)_poll_hook_execution()deleted — polling is no longer part of the AGW execution pathcall_hook()(legacy direct-HTTP path) is unchangedlocal_extensibility_example.jsonanduser-guide.mdupdated to reflect the new schemaType of Change
How to Test
Checklist
Breaking Changes
What breaks:
workflowId(notoolName/cardOrdId) will be silently skipped rather than used.Migration path:
ordId,cardOrdId,toolName,globalTenantId.call_hook()legacy path is unaffected.Alternative approaches considered:
workflow_idas an optional/deprecated field was ruled out to avoid maintaining a dead code path alongside the new model.Additional Notes
The
call_hook()method (direct HTTP path viaHookConfig) is intentionally left unchanged. Onlycall_hook_agw()and the underlying AGW helper methods are modified by this PR.