workflow-helpers
Skill0 starsChanged 10 months agoMITView on GitHub
Advanced n8n workflow manipulation. Extract webhook URLs, duplicate workflows, add nodes, create with triggers. Use for workflow management automation.
In this repository9 other files it gives its agents.
- create-credentialsSkill
- monitor-executionsSkill
- n8n-deploymentSkill
- n8n-diagnosticsSkill
- n8n-patternsSkill
- n8n-securitySkill
- n8n-testingSkill
- test-workflowSkill
- workflow-templatesSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Create a copy of a workflow, optionally stripping credentials:
- Distinctive: line 88
Add a new node to an existing workflow:
- Distinctive: line 116
Create a new workflow with a pre-configured trigger:
- Very specific: line 294
Strip Credentials for Sharing: Always use stripCredentials: true when duplicating for export
- Distinctive: line 295
Use Consistent Positioning: Keep nodes aligned (increment X by 200, Y by 200)
- Distinctive: line 296
Name Nodes Clearly: Use descriptive names for each node
- Distinctive: line 297
Test After Changes: Verify workflow after adding nodes
- Distinctive: line 298
Document Webhooks: Keep track of exposed webhook URLs
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workflow Helpers Skill
This skill provides advanced workflow manipulation capabilities for n8n.
When to Use
- Getting webhook URLs from workflows
- Duplicating workflows (with credential stripping for sharing)
- Adding nodes to existing workflows
- Creating workflows with specific triggers
- Getting workflow statistics
Core Methods
Get Webhook URL
Extract the webhook URL from a workflow:
const result = await workflowHelper.getWebhookUrl(workflowId)Result:
interface WebhookUrlResult {
success: boolean
url?: string // Full webhook URL
path?: string // Webhook path
method?: string // HTTP method (GET, POST, etc.)
error?: string
}Example:
const webhook = await workflowHelper.getWebhookUrl('123')
if (webhook.success) {
console.log(`URL: ${webhook.url}`)
// https://n8n.example.com/webhook/my-path
console.log(`Method: ${webhook.method}`)
// POST
}Duplicate Workflow
Create a copy of a workflow, optionally stripping credentials:
const result = await workflowHelper.duplicate(
sourceId, // Source workflow ID
newName, // Name for the copy
stripCredentials // Remove credentials (default: true)
)Result:
interface DuplicateResult {
success: boolean
workflowId?: string // New workflow ID
name?: string
error?: string
}Example:
// Create shareable copy (no credentials)
const copy = await workflowHelper.duplicate('123', 'My Workflow - Copy', true)
if (copy.success) {
console.log(`Created workflow: ${copy.workflowId}`)
}
// Create working copy (keep credentials)
const workingCopy = await workflowHelper.duplicate('123', 'My Workflow - Dev', false)Add Node to Workflow
Add a new node to an existing workflow:
const result = await workflowHelper.addNode(workflowId, {
name: 'My Node',
type: 'n8n-nodes-base.httpRequest',
position: [450, 300],
parameters: {
url: 'https://api.example.com',
method: 'GET'
},
credentials: {
httpHeaderAuth: { id: 'cred-id', name: 'My Auth' }
}
})Result:
interface AddNodeResult {
success: boolean
nodeName?: string
error?: string
}Create Workflow with Trigger
Create a new workflow with a pre-configured trigger:
const result = await workflowHelper.createWithTrigger(
name, // Workflow name
triggerType, // 'manual' | 'webhook' | 'schedule'
triggerConfig // Optional trigger configuration
)Trigger types:
Manual Trigger
await workflowHelper.createWithTrigger(
'My Manual Workflow',
'manual'
)Webhook Trigger
await workflowHelper.createWithTrigger(
'My Webhook Workflow',
'webhook',
{
path: 'my-webhook',
method: 'POST'
}
)Schedule Trigger
await workflowHelper.createWithTrigger(
'My Scheduled Workflow',
'schedule',
{
interval: 60 // Every 60 minutes
}
)Get Workflow Statistics
Get statistics about a workflow:
const stats = await workflowHelper.getStats(workflowId)Returns:
{
nodeCount: number // Number of nodes
isActive: boolean // Workflow active status
hasWebhook: boolean // Contains webhook node
hasCredentials: boolean // Contains credential-using nodes
triggerType?: string // Type of trigger node
}Usage Examples
Get Webhook for Integration
// Get webhook URL to share with external service
const webhook = await workflowHelper.getWebhookUrl('my-workflow-id')
if (webhook.success) {
console.log('Configure your service to POST to:')
console.log(webhook.url)
} else {
console.error('No webhook found in workflow')
}Create Template Copy
// Duplicate a template workflow for a new project
const result = await workflowHelper.duplicate(
'template-workflow-id',
'Project XYZ - Slack Notifications',
true // Strip credentials - user will add their own
)
if (result.success) {
console.log(`Created workflow: ${result.workflowId}`)
console.log('Remember to configure credentials!')
}Build Workflow Programmatically
// Create base workflow with webhook
const workflow = await workflowHelper.createWithTrigger(
'Customer Feedback Processor',
'webhook',
{ path: 'feedback', method: 'POST' }
)
if (workflow.success) {
// Add processing node
await workflowHelper.addNode(workflow.workflowId, {
name: 'Process Feedback',
type: 'n8n-nodes-base.function',
position: [450, 300],
parameters: {
functionCode: `
const feedback = items[0].json;
return [{
json: {
sentiment: feedback.rating > 3 ? 'positive' : 'negative',
...feedback
}
}];
`
}
})
// Add notification node
await workflowHelper.addNode(workflow.workflowId, {
name: 'Send to Slack',
type: 'n8n-nodes-base.slack',
position: [650, 300],
parameters: {
channel: '#feedback',
text: '={{ $json.sentiment }}: {{ $json.message }}'
}
})
}Workflow Audit
// Audit all workflows for security
const workflows = await client.listWorkflows()
for (const wf of workflows.data) {
const stats = await workflowHelper.getStats(String(wf.id))
console.log(`\n${wf.name}:`)
console.log(` Nodes: ${stats.nodeCount}`)
console.log(` Active: ${stats.isActive}`)
console.log(` Has Webhook: ${stats.hasWebhook}`)
console.log(` Uses Credentials: ${stats.hasCredentials}`)
if (stats.hasWebhook && stats.isActive) {
const webhook = await workflowHelper.getWebhookUrl(String(wf.id))
console.log(` Webhook URL: ${webhook.url}`)
}
}Node Types Reference
Common node types for addNode:
| Purpose | Node Type |
| HTTP Request | n8n-nodes-base.httpRequest |
| Function (JS) | n8n-nodes-base.function |
| Set Data | n8n-nodes-base.set |
| IF Condition | n8n-nodes-base.if |
| Switch | n8n-nodes-base.switch |
| Merge | n8n-nodes-base.merge |
| Split In Batches | n8n-nodes-base.splitInBatches |
| Slack | n8n-nodes-base.slack |
| Telegram | n8n-nodes-base.telegram |
| PostgreSQL | n8n-nodes-base.postgres |
| MySQL | n8n-nodes-base.mySql |
Best Practices
- Strip Credentials for Sharing: Always use
stripCredentials: truewhen duplicating for export - Use Consistent Positioning: Keep nodes aligned (increment X by 200, Y by 200)
- Name Nodes Clearly: Use descriptive names for each node
- Test After Changes: Verify workflow after adding nodes
- Document Webhooks: Keep track of exposed webhook URLs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

