Repository navigation
feat: add N8nTools toolkit for n8n workflow automation - #7339
Open
AlsoTheZv3n wants to merge 2 commits into
Open
AlsoTheZv3n wants to merge 2 commits into
AlsoTheZv3n wants to merge 2 commits into
Conversation
Adds N8nTools — a toolkit for interacting with self-hosted n8n instances via the n8n REST API v1. Methods (7 sync + 7 async): - list_workflows / alist_workflows (with active_only filter and pagination) - get_workflow / aget_workflow - activate_workflow / aactivate_workflow - deactivate_workflow / adeactivate_workflow - list_executions / alist_executions (with workflow_id filter and pagination) - get_execution / aget_execution - delete_execution / adelete_execution Files: - libs/agno/agno/tools/n8n.py — N8nTools class - libs/agno/pyproject.toml — n8n optional extra - cookbook/91_tools/n8n_tools.py — cookbook example Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
PR TriageMissing tests: This PR modifies source code but does not include any test changes. Please add or update tests to cover your changes. |
35 tests covering: - Init (explicit params, env var, no key, trailing slash) - Flag registration (defaults, selective, all flag, no flags) - Async tool name mapping - Helper methods (URL building, headers, error formatting) - All 7 sync methods (happy path + pagination) - Error handling (401, 404, connection error) - 6 async methods (happy path + error handling) - aclose() behavior Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
|
This pull request has been automatically marked as stale due to 14 days of inactivity. If this is still relevant, please update it or leave a comment. |
This branch has not been deployed
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.
Summary
Adds
N8nTools— a toolkit for interacting with self-hosted n8n workflowautomation instances via the n8n REST API v1.
Closes #7338
What was added
libs/agno/agno/tools/n8n.py—N8nToolsclass with 7 sync + 7 async methods:list_workflows/alist_workflows(withactive_onlyfilter,limit/cursorpagination)get_workflow/aget_workflowactivate_workflow/aactivate_workflowdeactivate_workflow/adeactivate_workflowlist_executions/alist_executions(withworkflow_idfilter,limit/cursorpagination)get_execution/aget_executiondelete_execution/adelete_executionlibs/agno/pyproject.toml—n8noptional extra added + entry intoolslistcookbook/91_tools/n8n_tools.py— cookbook example showing an agent monitoring n8n workflowsPattern followed
Built following the same patterns as:
GitlabTools— REST API + async httpx + flag-based registration + async_tools tuplesSerpApiTools— API key handling viagetenv()+allflagType of change
Checklist
./scripts/format.shand./scripts/validate.sh)Duplicate and AI-Generated PR Check
Testing
limit/cursoracross multiple pagesallflag verified to override individualenable_*flags./scripts/format.sh— 0 errors./scripts/validate.sh(ruff check) — 0 errorsAdditional Notes
httpxis already a core dependency of agno, so no additional package installation is neededlist_workflowsandlist_executionsexposelimitandcursorparameters and returnnextCursorin the response