I tried to build `` n8n '' on my own server that can be fully automatic linkage like IFTTT or Zapier like free



IFTTT and Zapier are well known for automating routine tasks by linking multiple web services, but some services can only be used with certain services or can only be used with paid plans. The automation service ' n8n ' that can be used with open source is available free of charge, and it is possible to automate services that are not supported by other automation services such as in-house software, so I actually tried using it.

n8n.io-Workflow Automation
https://n8n.io/

First, access the homepage of n8n.



When you proceed to the bottom of the homepage, the installation method was described. This time, install n8n on

Ubuntu on WSL which is one of the features of Windows 10.



Node.js is required to operate n8n, so install the latest recommended version of Node.js at the time of article creation.

Node.js
https://nodejs.org/ja/



Since the command described on the official page did not have sufficient permissions and an error occurred during installation, the following command was executed to install n8n.

[code] sudo npm install n8n -g --unsafe-perm = true --allow-root [/ code]



After the installation is completed, execute the following command to start n8n.

[code] n8n [/ code]



After starting n8n, when accessing '

http: // localhost: 5678 ' from the browser, the screen of n8n was displayed. In n8n, work units called 'nodes' are connected to create a 'workflow' that is a series of work flows.



This is the official video that records how the workflow is actually registered at n8n.

n8n.io-Slack Notification on Github Star-YouTube


Let's make a workflow to 'get RSS feed of GIGAZINE and save it locally in JSON format'. Press the '+' button ...



The list of 'nodes' that are the units of work is displayed. The number of services that can be linked is smaller than IFTTT or Zapier.



First, I want to get an RSS feed, so when I search for 'RSS', 'RSS Read' hits and clicks.



I was prompted for the URL of the RSS feed.



After entering the URL, click 'Execute Node' to confirm that you can get the RSS feed properly.



I was able to get the RSS feed in JSON format.



When returning to the home, the node of 'RSS Feed Read' was displayed. The “Start” node is the starting point of the work, so drag the two nodes end to end to connect.



When connected, a line was displayed between the two nodes.



Next, convert the JSON information acquired by the “RSS Feed Read” node into a format that can be written to a file. Search 'binary' on the node search screen and click 'Move Binary Data'.



Set the mode to 'JSON to Binary' because it converts from JSON to a format that can be written to a file.



Drag the 'RSS Feed Read' node and the 'Move Binary Data' node together.



Use the 'Write Binary File' node to write the last converted JSON information to a file.



Enter the file name and return to home.



Connect all nodes and press the 'Execute Workflow' button ...



The workflow was executed and a success message was displayed in the lower right.



The output file is saved in the current directory when n8n is executed. Looking at the contents of the file, the RSS feed was output properly.



You can also create a workflow that is triggered by some action, such as a 'Cron' node that starts the workflow at a fixed time. In that case, you need to turn on 'Active' in the upper right.



Hover over the top icon in the list on the left to save or delete the workflow.



Click the second lock to bring up a screen to manage web service accounts to be linked.



Click the third list mark to check the operation history of the node.



You can easily use the workflow uploaded on the

n8n official page . Go to the page of the workflow you want to use ...



Click the code part of the workflow. The workflow is now copied.



Returning to the n8n home and pressing Ctrl + V, I could easily copy the workflow.



Although there are few services that can be linked, the possibility of automation is greatly expanded by using the 'Execute Command' node, a convenient node that can execute commands of the server running n8n.



The output of basic command execution can of course be output.



You can also use various APIs of web services that n8n does not support. For example, if you use

LINE Messeging API ...



You can post RSS feeds to LINE.



Various logs collected on the server can of course be obtained.



You can also use it as a geeky way to get the input voltage from the

UPS and post it to LINE every minute.



In actual use, there are few services that can be officially linked, but there is an 'Execute Command' node that can execute server-side commands, so the services that can be linked are virtually endless. I felt it was a very convenient automation service depending on how I used it.

in Review,   Web Application, Posted by darkhorse_log