How eric050828/n8n-sdk-python works
Project type and purpose
• This repository is an open-source Python SDK (client library) for interacting with the n8n workflow automation platform’s REST API.
• Its purpose is to provide Python‐native wrappers (“clients”) for each n8n resource (workflows, credentials, executions, etc.), plus data models and utility helpers, so that other Python applications can programmatically manage n8n.
File structure
• Top-level packaging and metadata:
• setup.py, pyproject.toml, LICENSE, CHANGELOG.md
• .github/workflows/publish-to-pypi.yml – CI/CD for publishing releases
• .env.example – sample environment variables
• Core library under n8n_sdk_python/:
• client/ – per-resource API wrapper modules (audit.py, workflows.py, …)
• models/ – Pydantic-style classes representing request/response payloads
• utils/ – shared helpers (errors.py, logger.py)
• Entry points & examples:
• examples/simple_case.py – shows typical usage
• tests/ – unit tests targeting each client/model
• Documentation: docs/README_TW.md and main README.md describe setup, usage, and environment configuration.
README for additional insights
• SDK is asynchronous (users call await client.method(...))
• Configuration is driven by environment variables (N8N_BASE_URL, N8N_API_KEY) or explicit parameters
• Emphasis on Python 3.8+, virtual environments, python-dotenv for .env loading
Elements
• Application → Client (method calls)
• Client → HTTP Client → n8n API (HTTP request/response)
• HTTP Client → Model Layer (data parsing)
• Tests → Client/Models (validation)
• CI/CD → Repository → PyPI (publish)
Detail
• Sub-package (client, models, utils) as its own component.
• Flow of environment variables into the client constructor.
• Test suite as part of the architecture (mocking, test coverage).
• Packaging and distribution (setup.py, PyPI).