Ever wondered how the big players automate their workflows like a well-oiled machine? It’s all about setting up your task runner environment variables correctly. Let me tell you, if you’re running n8n, you’re in for a treat. Today, I’m going to walk you through how to configure task runners in n8n using environment variables. Trust me, this is going to revolutionize how you manage and automate your workflows.
First off, let’s get one thing straight: environment variables are the secret sauce for controlling task execution and beefing up your security settings in a self-hosted n8n instance. It’s like giving your task runners a personalized playbook. So, how do you set this up? Let’s dive in.
Setting Up Your Task Runner Environment Variables
One of the coolest tricks you can use is adding _FILE to individual variables. This allows you to provide their configuration in a separate file. It’s a neat way to keep things organized and secure. Here’s a rundown of some key environment variables you’ll want to know:
- N8N_RUNNERS_ENABLED: This is a Boolean variable with a default value of false. Flip this to true, and you’re ready to enable task runners. It’s like flipping the switch to power up your automation game.
- N8N_RUNNERS_MODE: An Enum string with options internal or external. This determines how you launch and run your task runner. Are you going to keep it in-house or outsource? Your call.
- N8N_RUNNERS_AUTH_TOKEN: A String variable used as a shared secret for authentication in external mode. Think of it as the secret handshake that lets your task runner into the club.
Now, let’s talk about the variables that set up the task launcher and its communication with the broker:
- N8N_RUNNERS_BROKER_PORT: A Number variable with a default value of 5679. This specifies the port for task broker connections. It’s like setting up a dedicated line for your task runners.
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS: A String variable with a default value of 127.0.0.1. This tells your task broker where to listen. It’s like giving your broker a specific address to hang out at.
- N8N_RUNNERS_MAX_PAYLOAD: A Number variable with a default value of 1,073,741,824 bytes. This sets the maximum payload size for communication. It’s like setting the limit on how much data your task runner can handle at once.
- N8N_RUNNERS_TASK_BROKER_URI: A String variable with a default value of http://127.0.0.1:5679. This specifies the task broker server URI. It’s like telling your task runner where to find the broker.
Security and Performance Configurations
When it comes to security and performance, you’ve got to be on top of your game. Here are some variables that help you control these aspects:
- N8N_RUNNERS_MAX_OLD_SPACE_SIZE: A String variable that specifies the –max-old-space-size option for a task runner in MB. It’s like setting the memory limit for your task runner, ensuring it doesn’t go overboard.
- N8N_RUNNERS_MAX_CONCURRENCY: A Number variable with a default value of 5. This controls the number of concurrent tasks a task runner can execute. It’s like managing the traffic flow to avoid a jam.
- N8N_RUNNERS_TASK_TIMEOUT: A Number variable with a default value of 60 seconds. This determines the time a task can take before aborting. It’s like setting a timer to ensure tasks don’t drag on forever.
- N8N_RUNNERS_HEARTBEAT_INTERVAL: A Number variable with a default value of 30 seconds. This sets the interval for runner heartbeats to the broker. It’s like a regular check-in to make sure everything’s running smoothly.
Controlling Logs and Node Configurations
Logs and node configurations are crucial for keeping your task runners in check. Here’s what you need to know:
- N8N_RUNNERS_LAUNCHER_LOG_LEVEL: An Enum string with options debug, info, warn, error, and a default of info. This controls log message visibility. It’s like adjusting the volume on your task runner’s feedback.
- NODE_FUNCTION_ALLOW_BUILTIN: A String variable to permit importing specific built-in modules in the Code node. It’s like giving your task runner permission to use certain tools.
- NODE_FUNCTION_ALLOW_EXTERNAL: A String variable to permit importing specific external modules in the Code node. It’s like allowing your task runner to reach out to external resources.
Idle Time and Timezone Settings
Finally, let’s talk about managing idle time and setting your timezone:
- N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT: A Number variable with a default value of 15 seconds. This sets the idle runner shutdown time. It’s like setting a timer to turn off the lights when no one’s home.
- GENERIC_TIMEZONE: A String variable with a default value of America/New_York. This sets the timezone. It’s like telling your task runner what time it is, so it knows when to start and stop.
So, there you have it. By setting up your task runner environment variables correctly, you’re not just automating your workflows; you’re taking control of your entire automation ecosystem. It’s like being the conductor of your own symphony of efficiency.
Ready to take your workflow automation to the next level? Dive into our other resources and see how you can streamline your processes even further. Trust me, once you get the hang of it, you’ll wonder how you ever managed without it.