Execute bash commands and scripts directly inside your n8n v2 container with full templating support.
Restore the power of command-line automation that was removed in n8n v2.
Features β’ Installation β’ Quick Start β’ Documentation β’ Examples β’ Support
Professional n8n Development & AI Automation Services
We specialize in building custom n8n nodes, workflows, and AI-driven solutions:
- π€ AI-Driven SEO - Automated content optimization and ranking strategies
- π§ Cold Email Automation - Intelligent outreach campaigns with n8n
- π» Application Development - Custom n8n nodes and workflow solutions
- π§ n8n Consulting - Expert workflow design and optimization
Visit shadowsoftware.com to learn more about our services.
n8n v2 removed the built-in Execute Command node for security reasons, leaving many users unable to:
- Process media files with FFmpeg
- Run shell scripts for data transformation
- Execute command-line tools in workflows
- Integrate with system utilities
This custom node brings back that power in a controlled, Docker-isolated environment with modern templating support.
- π Execute Any Bash Command - Run shell commands directly in your n8n container
- π Full Templating Support - Use
{{ $json.field }}to inject dynamic data from your workflow - βοΈ Environment Variables - Securely pass sensitive data without hardcoding
- β±οΈ Configurable Timeouts - Set execution limits to prevent hanging processes
- π Error Handling - Optional ignore-errors mode for fault-tolerant workflows
- π Detailed Output - Capture stdout, stderr, and exit codes
- π¬ FFmpeg Ready - Perfect for media processing workflows
- π³ Docker Isolated - Runs safely inside your n8n container
npm install n8n-nodes-custom-execThen restart n8n. The node will appear as "Custom Exec" in your node panel.
volumes:
- ./n8n-nodes-custom-exec/dist:/home/node/.n8n/customSee Installation Guide for detailed setup instructions.
Input JSON:
{
"name": "World",
"count": 42
}Command:
echo "Hello {{ $json.name }}! Count: {{ $json.count }}"Output:
{
"name": "World",
"count": 42,
"exec": {
"command": "echo \"Hello World! Count: 42\"",
"exitCode": 0,
"output": "Hello World! Count: 42\n"
}
}Transform images with dynamic text overlays:
Input:
{
"filename": "product-001",
"title": "SALE 50% OFF",
"slug": "sale-50-off"
}Command:
ffmpeg -i /home/node/input/{{ $json.filename }}.png \
-vf "drawtext=text='{{ $json.title }}':fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:fontsize=70:fontcolor=#FFDE21:x=(w-text_w)/2:y=(h-text_h)/2" \
/home/node/output/{{ $json.slug }}.webpCommand:
# Create directory and process files
mkdir -p /home/node/output/{{ $json.slug }} && \
convert {{ $json.image }} -resize 800x600 /home/node/output/{{ $json.slug }}/thumb.jpg && \
echo "Processed {{ $json.filename }}" > /home/node/output/{{ $json.slug }}/status.txtComprehensive guides for every use case:
- Quick Start Guide - Get running in 5 minutes
- Installation Instructions - Detailed setup for Docker and npm
- Project Overview - Architecture and design decisions
- Usage Examples - Real-world command examples
- FFmpeg media processing
- Image manipulation
- File operations
- Data transformation
- Python scripts
- Batch processing
- Publishing Guide - How to publish to npm
- Release Checklist - Quick reference for releases
- Setup Complete - GitHub Actions configuration
for file in /home/node/input/*.jpg; do
filename=$(basename "$file" .jpg)
ffmpeg -i "$file" -quality 85 "/home/node/output/${filename}.webp"
donepython3 -c "import csv, json; \
data = list(csv.DictReader(open('/home/node/data/{{ $json.csvFile }}.csv'))); \
json.dump(data, open('/home/node/output/{{ $json.outputName }}.json', 'w'), indent=2)"echo "<h1>{{ $json.title }}</h1><p>{{ $json.content }}</p>" | \
wkhtmltopdf - /home/node/pdfs/{{ $json.filename }}.pdfif [ "{{ $json.type }}" = "video" ]; then
ffmpeg -i /home/node/input/{{ $json.file }} -vf scale=1280:720 /home/node/output/{{ $json.file }}
else
cp /home/node/input/{{ $json.file }} /home/node/output/
fiSee Usage Examples for 20+ more examples.
Perfect for n8n users who need:
- Add watermarks to images
- Convert video formats
- Extract audio from video
- Generate thumbnails
- Batch resize images
- CSV/JSON conversion
- PDF generation
- File compression
- Format transformations
- Data validation
- File management
- Backup operations
- Log processing
- Cleanup tasks
- Monitoring scripts
- Call external APIs with curl
- Run Python/Ruby scripts
- Execute custom tools
- Process command output
- Chain multiple commands
| Setting | Default | Description |
|---|---|---|
| Command | - | Bash command to execute |
| Working Directory | /home/node |
Command execution directory |
| Timeout | 60000ms | Maximum execution time |
| Ignore Errors | false | Continue workflow on command failure |
| Environment Variables | - | Custom env vars for the command |
| Return Full Output | false | Include both stdout and stderr |
- Runs inside Docker container (isolated environment)
- No network access by default
- Configurable timeout prevents infinite loops
- Use environment variables for secrets
- Validate user input before passing to commands
git clone https://github.com/shadow-software/n8n-nodes-custom-exec-node.git
cd n8n-nodes-custom-exec-node
npm install
npm run buildnpm run docker:start
# Open http://localhost:5678
# Search for "Custom Exec" nodenpm run build # Build TypeScript
npm run dev # Watch mode
npm run docker:start # Start n8n
npm run docker:logs # View logs
npm run docker:ffmpeg # Start with FFmpeg installed- Package Name:
n8n-nodes-custom-exec - Repository: github.com/shadow-software/n8n-nodes-custom-exec-node
- npm Registry: npmjs.com/package/n8n-nodes-custom-exec
- License: MIT
- Size: ~5 KB (minified)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Initial release
- Execute bash commands with templating
- Environment variable support
- Configurable timeout and error handling
- Full stdout/stderr capture
- Issues: GitHub Issues
- Email: hello@shadowsoftware.com
- Website: shadowsoftware.com
If this node helped you, please give it a βοΈ on GitHub!
Shadow Software LLC builds production-ready n8n workflows and custom nodes for businesses.
π€ AI-Driven SEO Automation
- Automated content optimization
- Keyword research and analysis
- Rank tracking and reporting
- Content generation workflows
π§ Cold Email Campaigns
- Intelligent lead generation
- Personalized outreach at scale
- Response tracking and analytics
- A/B testing automation
π» Custom Application Development
- n8n node development
- Workflow automation consulting
- API integration services
- Database design and optimization
π― n8n Expertise
- Custom node development
- Complex workflow design
- Performance optimization
- Training and support
- β Specialized in n8n automation
- β AI-first development approach
- β Production-ready solutions
- β Ongoing support and maintenance
- β Transparent pricing
Ready to automate your business?
π Visit shadowsoftware.com or email hello@shadowsoftware.com
MIT License - see LICENSE file for details.
Copyright Β© 2025 Shadow Software LLC
