feat(extensibility): migrate n8n hook execution to per-workflow MCP tool invocation - #324
Open
rishikunnath2747 wants to merge 11 commits into
Open
rishikunnath2747 wants to merge 11 commits into
rishikunnath2747 wants to merge 11 commits into
Conversation
This commit adds the changes to migrate the extensibility module to support the new n8n architecture
This reverts commit 791d45f.
call_hook() references N8nWorkflowConfig.workflow_id which no longer exists after the n8n migration to MCP-based hooks, making it dead code that can never work. We suppressed the type errors with # ty: ignore rather than removing the method, to avoid a breaking change for any consumers still importing it.
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 schemaemit_extensions_summary_spannow includesjoule_studio_gsidsourced fromext_impl.joule_studio_gsid, propagating the Joule Studio global solution ID to the aggregate summary spanType of Change
Checklist
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.