axiom-coding-agent-setup 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/agent-browser/SKILL.md +55 -0
- package/.agents/skills/developing-with-streamlit/SKILL.md +220 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-chat-ui/SKILL.md +195 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/SKILL.md +233 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/packaged-components.md +212 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/state-sync.md +149 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/theme-css-variables.md +243 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/troubleshooting.md +121 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-dashboards/SKILL.md +147 -0
- package/.agents/skills/developing-with-streamlit/skills/building-streamlit-multipage-apps/SKILL.md +218 -0
- package/.agents/skills/developing-with-streamlit/skills/choosing-streamlit-selection-widgets/SKILL.md +139 -0
- package/.agents/skills/developing-with-streamlit/skills/connecting-streamlit-to-snowflake/SKILL.md +188 -0
- package/.agents/skills/developing-with-streamlit/skills/creating-streamlit-themes/SKILL.md +486 -0
- package/.agents/skills/developing-with-streamlit/skills/displaying-streamlit-data/SKILL.md +199 -0
- package/.agents/skills/developing-with-streamlit/skills/improving-streamlit-design/SKILL.md +191 -0
- package/.agents/skills/developing-with-streamlit/skills/optimizing-streamlit-performance/SKILL.md +323 -0
- package/.agents/skills/developing-with-streamlit/skills/organizing-streamlit-code/SKILL.md +91 -0
- package/.agents/skills/developing-with-streamlit/skills/setting-up-streamlit-environment/SKILL.md +128 -0
- package/.agents/skills/developing-with-streamlit/skills/using-streamlit-cli/SKILL.md +165 -0
- package/.agents/skills/developing-with-streamlit/skills/using-streamlit-custom-components/SKILL.md +170 -0
- package/.agents/skills/developing-with-streamlit/skills/using-streamlit-layouts/SKILL.md +229 -0
- package/.agents/skills/developing-with-streamlit/skills/using-streamlit-markdown/SKILL.md +207 -0
- package/.agents/skills/developing-with-streamlit/skills/using-streamlit-session-state/SKILL.md +144 -0
- package/.agents/skills/developing-with-streamlit/templates/.gitattributes +3 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/README.md +188 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-companies/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-companies/streamlit_app.py +365 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute/streamlit_app.py +461 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/.streamlit/secrets.toml.example +20 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/pyproject.toml +11 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/snowflake.yml +18 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/streamlit_app.py +527 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-feature-usage/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-feature-usage/streamlit_app.py +307 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics/streamlit_app.py +426 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/.streamlit/secrets.toml.example +20 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/pyproject.toml +11 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/snowflake.yml +18 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/streamlit_app.py +463 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-seattle-weather/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-seattle-weather/streamlit_app.py +252 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers/pyproject.toml +12 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers/streamlit_app.py +342 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/.streamlit/secrets.toml.example +20 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/pyproject.toml +11 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/snowflake.yml +18 -0
- package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/streamlit_app.py +384 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/README.md +128 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/dracula.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/github.toml +37 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/minimal.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/nord.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/snowflake.toml +42 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/solarized-light.toml +38 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/spotify.toml +34 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_configs/stripe.toml +35 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_shared/streamlit_app.py +336 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/_templates/pyproject.toml.tmpl +12 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/dracula/.streamlit/config.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/dracula/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/dracula/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/github/.streamlit/config.toml +37 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/github/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/github/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/manage.py +332 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/minimal/.streamlit/config.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/minimal/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/minimal/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/nord/.streamlit/config.toml +39 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/nord/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/nord/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/.streamlit/config.toml +42 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/.streamlit/config.toml +38 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/spotify/.streamlit/config.toml +34 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/spotify/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/spotify/streamlit_app.py +337 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/stripe/.streamlit/config.toml +35 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/stripe/pyproject.toml +10 -0
- package/.agents/skills/developing-with-streamlit/templates/themes/stripe/streamlit_app.py +337 -0
- package/.agents/skills/fastapi/SKILL.md +436 -0
- package/.agents/skills/fastapi/references/dependencies.md +142 -0
- package/.agents/skills/fastapi/references/other-tools.md +76 -0
- package/.agents/skills/fastapi/references/streaming.md +105 -0
- package/.agents/skills/frontend-design/LICENSE.txt +177 -0
- package/.agents/skills/frontend-design/SKILL.md +42 -0
- package/.agents/skills/gradio/SKILL.md +84 -0
- package/.agents/skills/gradio/references/api-signatures.md +115 -0
- package/.agents/skills/gradio/references/event-listeners.md +130 -0
- package/.agents/skills/gradio/references/examples.md +613 -0
- package/.agents/skills/ui-ux-pro-max/SKILL.md +659 -0
- package/.agents/skills/ui-ux-pro-max/data +1 -0
- package/.agents/skills/ui-ux-pro-max/scripts +1 -0
- package/.env.axiom +8 -0
- package/AGENTS.md +2 -1
- package/README.md +19 -3
- package/bin/cli.js +11 -1
- package/opencode.json +7 -4
- package/package.json +1 -1
- package/skills-lock.json +36 -0
- package/.agents/skills/n8n-patterns/SKILL.md +0 -272
|
@@ -0,0 +1 @@
|
|
|
1
|
+
../../../src/ui-ux-pro-max/data
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
../../../src/ui-ux-pro-max/scripts
|
package/.env.axiom
ADDED
package/AGENTS.md
CHANGED
|
@@ -36,4 +36,5 @@ I write code that survives contact with reality.
|
|
|
36
36
|
- NEVER declare "it works" without verification
|
|
37
37
|
- NEVER add dependencies without checking if built-ins suffice
|
|
38
38
|
- NEVER over-engineer for a scale that doesn't exist yet
|
|
39
|
-
- ALWAYS ask: "Does this solve the actual problem?"
|
|
39
|
+
- ALWAYS ask: "Does this solve the actual problem?"
|
|
40
|
+
- **ALWAYS reference the current date/time**: Today is {Month} {Year}. You search the current date in your operations and always remember that. When performing web searches or any time-sensitive queries, explicitly use the current year to avoid retrieving outdated results from previous years like 2024 or 2025.
|
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ npx axiom-setup
|
|
|
21
21
|
This command downloads the following files from the [axiom-coding-agent-setup](https://github.com/mcikalmerdeka/axiom-coding-agent-setup) repository into your current project directory:
|
|
22
22
|
|
|
23
23
|
- `AGENTS.md` — Main agent instructions
|
|
24
|
+
- `opencode.json` — OpenCode IDE configuration (MCP servers, plugins)
|
|
25
|
+
- `.env.axiom` — Environment variables template for AXIOM credentials
|
|
24
26
|
- `.agents/engineering.md` — Engineering principles & code standards
|
|
25
27
|
- `.agents/stack.md` — Technology stack knowledge
|
|
26
28
|
- `.agents/workflow.md` — Workflow guidelines & verification protocol
|
|
@@ -30,7 +32,13 @@ This command downloads the following files from the [axiom-coding-agent-setup](h
|
|
|
30
32
|
## Files Included
|
|
31
33
|
|
|
32
34
|
### AGENTS.md
|
|
33
|
-
The main instruction file that coding agents (Claude, Cursor, etc.) read first when working on your project.
|
|
35
|
+
The main instruction file that coding agents (Claude, Cursor, OpenCode, etc.) read first when working on your project.
|
|
36
|
+
|
|
37
|
+
### opencode.json
|
|
38
|
+
OpenCode IDE configuration including:
|
|
39
|
+
- MCP server definitions (remote tools like n8n, Neon, Gradio, etc.)
|
|
40
|
+
- Plugin configuration
|
|
41
|
+
- Environment variable references for secure credential management
|
|
34
42
|
|
|
35
43
|
### .agents/engineering.md
|
|
36
44
|
Core engineering principles including:
|
|
@@ -64,10 +72,18 @@ Project-type specific convention files:
|
|
|
64
72
|
|
|
65
73
|
### .agents/skills/
|
|
66
74
|
Domain-specific skills that can be loaded on-demand:
|
|
67
|
-
- `
|
|
68
|
-
- `n8n-patterns/` — n8n workflow automation patterns
|
|
75
|
+
- `agent-browser/` — Web browser automation skill
|
|
69
76
|
- `ai-integration/` — LLM/AI integration patterns
|
|
70
77
|
- `deployment-patterns/` — Deployment and infrastructure guide
|
|
78
|
+
- `developing-with-streamlit/` — Streamlit app development guides
|
|
79
|
+
- `fastapi/` — FastAPI best practices and patterns
|
|
80
|
+
- `fastapi-templates/` — FastAPI project templates
|
|
81
|
+
- `frontend-design/` — Frontend UI/UX design patterns
|
|
82
|
+
- `git-commit/` — Conventional commit message generation
|
|
83
|
+
- `gradio/` — Gradio UI framework guides
|
|
84
|
+
- `mcp-builder/` — MCP server development guide
|
|
85
|
+
- `n8n-patterns/` — n8n workflow automation patterns
|
|
86
|
+
- `ui-ux-pro-max/` — Advanced UI/UX design skill
|
|
71
87
|
|
|
72
88
|
## Development
|
|
73
89
|
|
package/bin/cli.js
CHANGED
|
@@ -20,6 +20,8 @@ const FILES_TO_DOWNLOAD = [
|
|
|
20
20
|
'AGENTS.md',
|
|
21
21
|
// OpenCode configuration
|
|
22
22
|
'opencode.json',
|
|
23
|
+
// Environment variables template
|
|
24
|
+
'.env.axiom',
|
|
23
25
|
// Core agent documents
|
|
24
26
|
'.agents/engineering.md',
|
|
25
27
|
'.agents/stack.md',
|
|
@@ -28,12 +30,18 @@ const FILES_TO_DOWNLOAD = [
|
|
|
28
30
|
'.agents/templates/ai-engineering-python.md',
|
|
29
31
|
'.agents/templates/fullstack-ai-nextjs.md',
|
|
30
32
|
// Skills (domain-specific guides)
|
|
33
|
+
'.agents/skills/agent-browser/SKILL.md',
|
|
31
34
|
'.agents/skills/ai-integration/SKILL.md',
|
|
32
35
|
'.agents/skills/deployment-patterns/SKILL.md',
|
|
36
|
+
'.agents/skills/developing-with-streamlit/SKILL.md',
|
|
37
|
+
'.agents/skills/fastapi/SKILL.md',
|
|
33
38
|
'.agents/skills/fastapi-templates/SKILL.md',
|
|
39
|
+
'.agents/skills/frontend-design/SKILL.md',
|
|
34
40
|
'.agents/skills/git-commit/SKILL.md',
|
|
41
|
+
'.agents/skills/gradio/SKILL.md',
|
|
35
42
|
'.agents/skills/mcp-builder/SKILL.md',
|
|
36
|
-
'.agents/skills/n8n-patterns/SKILL.md'
|
|
43
|
+
'.agents/skills/n8n-patterns/SKILL.md',
|
|
44
|
+
'.agents/skills/ui-ux-pro-max/SKILL.md'
|
|
37
45
|
];
|
|
38
46
|
|
|
39
47
|
const GITHUB_RAW_URL = `https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${BRANCH}`;
|
|
@@ -127,6 +135,8 @@ async function main() {
|
|
|
127
135
|
if (successCount > 0) {
|
|
128
136
|
log('Your project now has AXIOM coding agent instructions:', 'bold');
|
|
129
137
|
log(' - AGENTS.md → Main agent instructions', 'cyan');
|
|
138
|
+
log(' - opencode.json → OpenCode IDE configuration', 'cyan');
|
|
139
|
+
log(' - .env.axiom → Environment variables template', 'cyan');
|
|
130
140
|
log(' - .agents/engineering.md → Engineering principles', 'cyan');
|
|
131
141
|
log(' - .agents/stack.md → Tech stack knowledge', 'cyan');
|
|
132
142
|
log(' - .agents/workflow.md → Workflow guidelines', 'cyan');
|
package/opencode.json
CHANGED
|
@@ -32,11 +32,14 @@
|
|
|
32
32
|
"enabled": true,
|
|
33
33
|
"headers": {}
|
|
34
34
|
},
|
|
35
|
-
"n8n-
|
|
35
|
+
"n8n-mcp": {
|
|
36
36
|
"type": "remote",
|
|
37
|
-
"url": "
|
|
37
|
+
"url": "http://localhost:5678/mcp-server/http",
|
|
38
38
|
"enabled": true,
|
|
39
|
-
"headers": {
|
|
39
|
+
"headers": {
|
|
40
|
+
"Authorization": "Bearer {env:N8N_MCP_TOKEN}"
|
|
41
|
+
},
|
|
42
|
+
"oauth": false
|
|
40
43
|
},
|
|
41
44
|
"exa": {
|
|
42
45
|
"type": "remote",
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
"url": "https://mcp.neon.tech/mcp",
|
|
50
53
|
"enabled": true,
|
|
51
54
|
"headers": {
|
|
52
|
-
"Authorization": "Bearer
|
|
55
|
+
"Authorization": "Bearer {env:NEON_API_KEY}"
|
|
53
56
|
}
|
|
54
57
|
},
|
|
55
58
|
"eraser": {
|
package/package.json
CHANGED
package/skills-lock.json
CHANGED
|
@@ -1,15 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"skills": {
|
|
4
|
+
"agent-browser": {
|
|
5
|
+
"source": "vercel-labs/agent-browser",
|
|
6
|
+
"sourceType": "github",
|
|
7
|
+
"skillPath": "skills/agent-browser/SKILL.md",
|
|
8
|
+
"computedHash": "228f87d57035100d9dc6efcfc05aafd4b6e3962adacaa04b8217ab2fadb15dc8"
|
|
9
|
+
},
|
|
10
|
+
"developing-with-streamlit": {
|
|
11
|
+
"source": "streamlit/agent-skills",
|
|
12
|
+
"sourceType": "github",
|
|
13
|
+
"skillPath": "developing-with-streamlit/SKILL.md",
|
|
14
|
+
"computedHash": "51823384978f738f76ff8f601e11c1343aebea03d2ad782dc73fc22d3f129812"
|
|
15
|
+
},
|
|
16
|
+
"fastapi": {
|
|
17
|
+
"source": "fastapi/fastapi",
|
|
18
|
+
"sourceType": "github",
|
|
19
|
+
"skillPath": "fastapi/.agents/skills/fastapi/SKILL.md",
|
|
20
|
+
"computedHash": "9feb517089c269af4fdab5031dea1100a92fd50081e906ccfaf8a971858e39f9"
|
|
21
|
+
},
|
|
4
22
|
"fastapi-templates": {
|
|
5
23
|
"source": "wshobson/agents",
|
|
6
24
|
"sourceType": "github",
|
|
7
25
|
"computedHash": "1a5fe66bd2683afd1db9afdf37a25cd8b9195c369c98489333badf0406fc91b3"
|
|
8
26
|
},
|
|
27
|
+
"frontend-design": {
|
|
28
|
+
"source": "anthropics/skills",
|
|
29
|
+
"sourceType": "github",
|
|
30
|
+
"skillPath": "skills/frontend-design/SKILL.md",
|
|
31
|
+
"computedHash": "516bd2154eb843a8240e43d5b285229129853114ad7075a5e141e1c08e408c84"
|
|
32
|
+
},
|
|
9
33
|
"git-commit": {
|
|
10
34
|
"source": "github/awesome-copilot",
|
|
11
35
|
"sourceType": "github",
|
|
12
36
|
"computedHash": "2607fc60629b82b257136dd2a7a373f0a4466c0b49df7746d845d59313c99b21"
|
|
37
|
+
},
|
|
38
|
+
"gradio": {
|
|
39
|
+
"source": "gradio-app/gradio",
|
|
40
|
+
"sourceType": "github",
|
|
41
|
+
"skillPath": ".agents/skills/gradio/SKILL.md",
|
|
42
|
+
"computedHash": "5078d8a4cc2b562731620f36f5f0d3ad054bd51f7a98baa547b04b893744823b"
|
|
43
|
+
},
|
|
44
|
+
"ui-ux-pro-max": {
|
|
45
|
+
"source": "nextlevelbuilder/ui-ux-pro-max-skill",
|
|
46
|
+
"sourceType": "github",
|
|
47
|
+
"skillPath": ".claude/skills/ui-ux-pro-max/SKILL.md",
|
|
48
|
+
"computedHash": "6337038fe1fe6bbe1b9f252ab678ee575859190bab6f0f246f4061824eb40875"
|
|
13
49
|
}
|
|
14
50
|
}
|
|
15
51
|
}
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: n8n-workflow-patterns
|
|
3
|
-
description: Best practices and patterns for building production-ready n8n workflows. Use when designing, building, or debugging n8n automation workflows.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# n8n Workflow Patterns Guide
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
n8n is a workflow automation platform that connects apps and services. This skill covers patterns for building maintainable, reliable, and scalable workflows.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## When to Use This Skill
|
|
15
|
-
|
|
16
|
-
- Designing new n8n workflows
|
|
17
|
-
- Refactoring existing workflows for better reliability
|
|
18
|
-
- Debugging failing workflows
|
|
19
|
-
- Building integrations between services
|
|
20
|
-
- Creating scheduled automation
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Core Principles
|
|
25
|
-
|
|
26
|
-
### 1. Workflow Design Patterns
|
|
27
|
-
|
|
28
|
-
**Single Responsibility**
|
|
29
|
-
Each workflow should do one thing well. Complex automations should be split into multiple workflows connected via:
|
|
30
|
-
- Execute Workflow node
|
|
31
|
-
- Webhook triggers
|
|
32
|
-
- n8n API
|
|
33
|
-
|
|
34
|
-
**Fail-Fast and Loud**
|
|
35
|
-
- Use Error Trigger workflows for centralized error handling
|
|
36
|
-
- Never silently swallow errors
|
|
37
|
-
- Send notifications on failures
|
|
38
|
-
|
|
39
|
-
**Idempotency**
|
|
40
|
-
Design workflows to be safely re-runnable:
|
|
41
|
-
- Check if action already performed before doing it
|
|
42
|
-
- Use deduplication keys
|
|
43
|
-
- Handle duplicate webhook calls gracefully
|
|
44
|
-
|
|
45
|
-
### 2. Node Patterns
|
|
46
|
-
|
|
47
|
-
**HTTP Request Node**
|
|
48
|
-
```
|
|
49
|
-
Best Practices:
|
|
50
|
-
- Always set timeout (default 5 min is often too long)
|
|
51
|
-
- Handle 4xx and 5xx errors explicitly
|
|
52
|
-
- Use pagination for large datasets
|
|
53
|
-
- Implement retry logic for transient failures
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Code Node**
|
|
57
|
-
```javascript
|
|
58
|
-
// Good: Input validation
|
|
59
|
-
const input = $input.first().json;
|
|
60
|
-
if (!input.email) {
|
|
61
|
-
throw new Error('Email is required');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Good: Error handling with context
|
|
65
|
-
try {
|
|
66
|
-
const result = await someAsyncOperation();
|
|
67
|
-
return [{ json: result }];
|
|
68
|
-
} catch (error) {
|
|
69
|
-
// Log context for debugging
|
|
70
|
-
console.error('Operation failed:', { input: input.id, error: error.message });
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Function Node (Legacy)**
|
|
76
|
-
Prefer Code Node over Function Node in new workflows.
|
|
77
|
-
|
|
78
|
-
### 3. Data Handling
|
|
79
|
-
|
|
80
|
-
**Passing Data Between Nodes**
|
|
81
|
-
```javascript
|
|
82
|
-
// Access previous node data
|
|
83
|
-
const items = $input.all();
|
|
84
|
-
const firstItem = $input.first().json;
|
|
85
|
-
|
|
86
|
-
// Reference specific node output
|
|
87
|
-
const data = $('Node Name').first().json;
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Transforming Data**
|
|
91
|
-
```javascript
|
|
92
|
-
// Map over items
|
|
93
|
-
const results = items.map(item => ({
|
|
94
|
-
json: {
|
|
95
|
-
id: item.json.id,
|
|
96
|
-
name: item.json.name.toUpperCase(),
|
|
97
|
-
processed: true,
|
|
98
|
-
}
|
|
99
|
-
}));
|
|
100
|
-
return results;
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 4. Error Handling
|
|
104
|
-
|
|
105
|
-
**Try-Catch Pattern**
|
|
106
|
-
```javascript
|
|
107
|
-
try {
|
|
108
|
-
// Risky operation
|
|
109
|
-
const result = await riskyCall();
|
|
110
|
-
return [{ json: { success: true, data: result } }];
|
|
111
|
-
} catch (error) {
|
|
112
|
-
// Return error in structured format
|
|
113
|
-
return [{
|
|
114
|
-
json: {
|
|
115
|
-
success: false,
|
|
116
|
-
error: error.message,
|
|
117
|
-
timestamp: new Date().toISOString(),
|
|
118
|
-
}
|
|
119
|
-
}];
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**Error Workflow**
|
|
124
|
-
Create a dedicated workflow for error handling:
|
|
125
|
-
- Trigger: Error Trigger node
|
|
126
|
-
- Actions: Log to database, send Slack/email notification, retry logic
|
|
127
|
-
|
|
128
|
-
### 5. Credential Management
|
|
129
|
-
|
|
130
|
-
**Security Best Practices**
|
|
131
|
-
- Never hardcode credentials in Code nodes
|
|
132
|
-
- Always use n8n credential system
|
|
133
|
-
- Rotate credentials regularly
|
|
134
|
-
- Use least-privilege access for service accounts
|
|
135
|
-
|
|
136
|
-
**Custom Credentials**
|
|
137
|
-
For custom APIs, create a generic credential type or use HTTP Request node with OAuth.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Workflow Architecture Patterns
|
|
142
|
-
|
|
143
|
-
### Pattern 1: Webhook Receiver
|
|
144
|
-
```
|
|
145
|
-
Webhook Node → Validation → Processing → Response
|
|
146
|
-
↓
|
|
147
|
-
Error Handler
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Use for: Real-time integrations, external service callbacks
|
|
151
|
-
|
|
152
|
-
### Pattern 2: Scheduled Job
|
|
153
|
-
```
|
|
154
|
-
Schedule Trigger → Data Fetch → Transform → Action → Notification
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Use for: Daily reports, data sync, cleanup tasks
|
|
158
|
-
|
|
159
|
-
### Pattern 3: Event-Driven Chain
|
|
160
|
-
```
|
|
161
|
-
Trigger → Filter → Enrich → Route → Multiple Actions
|
|
162
|
-
↙ ↓ ↘
|
|
163
|
-
Action1 Action2 Action3
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Use for: Complex automation with conditional branches
|
|
167
|
-
|
|
168
|
-
### Pattern 4: Workflow Orchestration
|
|
169
|
-
```
|
|
170
|
-
Main Workflow → Execute Workflow (Sub-workflow 1)
|
|
171
|
-
→ Execute Workflow (Sub-workflow 2)
|
|
172
|
-
→ Aggregate Results
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Use for: Complex multi-step processes, reusable components
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Debugging Workflows
|
|
180
|
-
|
|
181
|
-
### Enable Execution Logging
|
|
182
|
-
```
|
|
183
|
-
Settings → Log Execution → Enable
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Use Debug Nodes
|
|
187
|
-
Insert Set nodes to inspect data at specific points:
|
|
188
|
-
```javascript
|
|
189
|
-
// Debug node output
|
|
190
|
-
{
|
|
191
|
-
"debug_stage": "after_api_call",
|
|
192
|
-
"raw_response": $input.first().json,
|
|
193
|
-
"item_count": $input.all().length
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Common Issues
|
|
198
|
-
|
|
199
|
-
**Issue: Data not passing between nodes**
|
|
200
|
-
- Check if previous node outputs items
|
|
201
|
-
- Verify item structure matches expected input
|
|
202
|
-
- Use Code node to inspect `$input`
|
|
203
|
-
|
|
204
|
-
**Issue: Workflow times out**
|
|
205
|
-
- Add pagination for large datasets
|
|
206
|
-
- Use Split In Batches node
|
|
207
|
-
- Consider splitting into multiple workflows
|
|
208
|
-
|
|
209
|
-
**Issue: Rate limiting**
|
|
210
|
-
- Add Wait nodes between API calls
|
|
211
|
-
- Implement exponential backoff
|
|
212
|
-
- Use queue-based processing
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Performance Optimization
|
|
217
|
-
|
|
218
|
-
### Batch Processing
|
|
219
|
-
```
|
|
220
|
-
Split In Batches (100 items/batch) → Process → Wait 1s → Loop
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Parallel Processing
|
|
224
|
-
```
|
|
225
|
-
→ Process A
|
|
226
|
-
Split → Route → Process B
|
|
227
|
-
→ Process C
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Caching
|
|
231
|
-
Use the Static Data feature to cache:
|
|
232
|
-
- Access tokens
|
|
233
|
-
- Reference data
|
|
234
|
-
- Configuration
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
|
-
## Code Node Utilities
|
|
239
|
-
|
|
240
|
-
### Common Helpers
|
|
241
|
-
```javascript
|
|
242
|
-
// Date formatting
|
|
243
|
-
const now = new Date().toISOString();
|
|
244
|
-
const formatted = new Date().toLocaleDateString('en-US');
|
|
245
|
-
|
|
246
|
-
// Generate unique ID
|
|
247
|
-
const id = Date.now().toString(36) + Math.random().toString(36).substr(2);
|
|
248
|
-
|
|
249
|
-
// Sleep function
|
|
250
|
-
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
251
|
-
|
|
252
|
-
// Retry wrapper
|
|
253
|
-
async function withRetry(fn, maxAttempts = 3) {
|
|
254
|
-
for (let i = 0; i < maxAttempts; i++) {
|
|
255
|
-
try {
|
|
256
|
-
return await fn();
|
|
257
|
-
} catch (error) {
|
|
258
|
-
if (i === maxAttempts - 1) throw error;
|
|
259
|
-
await sleep(1000 * (i + 1)); // Exponential backoff
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Resources
|
|
268
|
-
|
|
269
|
-
- **n8n Docs**: https://docs.n8n.io/
|
|
270
|
-
- **Workflow Templates**: https://n8n.io/workflows
|
|
271
|
-
- **Community Forum**: https://community.n8n.io/
|
|
272
|
-
- **Node Reference**: https://docs.n8n.io/integrations/builtin/
|