Templates
n8n Workflow Automation
8min
n8n is a free and open source workflow automation tool, that enables teams to automate tasks across different services microtica offers a ready to use template to deploy an n8n application as part of our free templates pack you can deploy an n8n application on our demo kubernetes cluster to get started when ready, you can self host n8n on your own aws account and setup a production ready solution in minutes one click deploy click deploy with microtica below and follow the template steps to deploy an n8n application on your aws account built in environment variables below is a list of built in environment variables provided in the n8n runtime name description required databasepassword password for the postgresql database yes custom environment variables to simplify the initial setup, this template sets the default configuration for the n8n application if you need to customize the configuration and use custom variables like n8n smtp host, n8n smtp pass (see the full list of environment variables ) you can to that in two ways configure environment variables from microtica console to configure environment variable from microtica console you need to first define the variables in the schema json file the input properties defined here will become available in the microtica console with this approach you get consistent configuration for the application as well as strong validation rules { "$schema" "http //json schema org/draft 07/schema#", "$id" "schema //microtica/schema json", "title" "application schema", "type" "object", "properties" { "inputs" { "type" "object", "properties" { "n8n smtp host" { "type" "string", "default" "smtp sendgrid net", "description" "smtp server host name address use an empty string to disable all mail sending from the server the default value for this variable is an empty string" }, "n8n smtp pass" { "type" "string", "sensitive" true, "description" "smtp server password (encrypted)" } }, "required" \[] } }, "additionalproperties" false } enhance security measures by using sensitive parameters, such as n8n smtp pass, as 'sensitive' within the schema json file, thereby ensuring their encryption for better protection next, to inject the environment variable in the application container runtime, just reference the variable using the {{env var name}} syntax \# apiversion apps/v1 kind deployment metadata namespace "{{mic namespace}}" name "{{mic name}}" labels app "{{mic name}}" microticaservice "{{mic name}}" spec replicas 1 template spec containers \ name "{{mic name}}" image "{{mic image}}" env \# reference the environment variable \# during deployment the placeholder will be replaced with the configured value \ name n8n smtp host value "{{n8n smtp host}}" \# \# reference the sensitive environment variable \ name n8n smtp pass valuefrom secretkeyref name {{mic secret name}} key n8n smtp pass \# configure environment variables directly in the kubernetes spec to configure an environment variable directly in the kubernetes spec you need to update the kube config file similar to the previous example, now provide the environment variable value directly in the spec \# apiversion apps/v1 kind deployment metadata namespace "{{mic namespace}}" name "{{mic name}}" labels app "{{mic name}}" microticaservice "{{mic name}}" spec replicas 1 template spec containers \ name "{{mic name}}" image "{{mic name}}" env \# provide the environment variable value directly in the spec \ name n8n smtp host value "smtp sendgrid net" \# \# estimated aws cost the estimated cost of the aws cloud depends on the configuration of the n8n infrastructure below is the cost estimation breakdown assuming the resources are running all the time eks cluster $70/month application load balancer $17/month 2 x t3 large ec2 instances $60/month total cost per month with this minimal configuration is approximately $150/month optimize aws cost to save costs while using n8n in a non production environment, consider running it from monday to friday, 8 hours per day this schedule can help you achieve at least a 65% reduction in your cloud expenses in the resources or cost dashboard , create a saving schedule to implement these cost saving measures