32
loading...
This website collects cookies to deliver better user experience
npx create-strapi-app myblog --template https://github.com/hannydevelop/Strapi-template
blog
content type already created with field names: Blog_title
, Blog_description
, and Blog_content
. npx n8n
npm install n8n -g
n8n
with the command below:n8n start
n8n
is running on port 5678
. Navigate to http://localhost:5678/
in your web browser to get to the n8n workspace so that you can start building your workspace.My workflow
at the top of your workspace. You can call your workflow whatever you like and even add tags. For me, I'll name the workflow Strapi Workflow.start
node by default. To connect other nodes to our workflow, click and drag horizontally the black circle on the start node.Product new update
, while the description will be the Latest Update about our product
. The set node will allow us to set this information so that we don't type them repeatedly.set
and click on the set node below the search bar. Click on the Add Value
button under Values to Set, choose String
from the drop down menu. Fill-in name with Blog_title
and value with Product new update
. Add Value
button for the blog description. Fill-in name with Blog_description
and value with Latest update about our product
. Now, your set node entry should look like the image below.set
and click on the set node below the search bar. Click on the Add Value button under Values to Set, choose String
from the drop-down menu. Fill in name with Blog_title
and value with Product new update
. Add Value
button for the blog description. Fill in name with Blog_description
and value with Latest Update about our product
. Now, your set node entry should look like the image below.set
node window by clicking on the close button near the execute node button. set
node now has a green icon attached to it in your workspace. The next thing we'll do is create Strapi credentials to add the content we just created into our blog.Strapi API
box, select Create New
. You’ll need to fill-in credential name and credential data. localhost
. Users
collection type and click on Add New Users. confirmed
button to ON. Click on the Save button to add the new user.Roles
in your administration panel by navigating to Settings > Users & Permissions plugin > Roles. Notice that you have one authenticated user; this is the user account you just created. Click on authenticated. Under Permissions, click on Select all
and save.n8n
, fill-in credentials name
with the name of your choice. For example, I'll fill mine with a Strapi credential. Fill in the email and password with the email and password of the user you created in Strapi. Fill URL
with Strapi's base URL; http://localhost:1337
and click on the create button.n8n
, choose the Strapi credential you created earlier. Change the Operation
parameter to Create, fill-in blogs in the Content Type
parameter. Column
parameter will take in the fields of your blog. It is advisable you put in the same fields as the set
node. For instance, the Column
parameter should contain; **Blog_title**
, **Blog_description**
. set
node has been added at the execution of Strapi
'
s create entry node
.n8n
, choose the Strapi credential you created earlier. Change the Operation
parameter to Create, fill-in **blogs**
in the Content-Type
parameter. Column
parameter will take in the fields of your blog. It would be best if you put in the same fields as the set
node. Column
parameter should contain; **Blog_title**
, **Blog_description**
. When you click on the execute node button, notice that the content we put-in in our set
node has been added at the execution of Strapi's create entry node
.delete
, get
and getAll
entries won’t be part of our workflow, we’ll explore them briefly.Strapi's delete entry
. To delete an entry:Delete
.blogs
as the content type and put in the ID of the blog you want to delete and click on the execute node button.
GET
or getAll
operations in the Strapi node. For GET
operation, fill in the ID of the blog item you want and click on the Execute Node button.getAll
operation, you don't need a blog item ID. Toggle the Return All
button to show all of the blog items in your Strapi project. Click on the Execute Node button to return all of the items in your Strapi project.GitHub
node. Your workflow should look like this now.OAuth
application by following the steps below:https://n8n.io/
as your Homepage URL.Client ID
.Github OAuth2 API
, click on Create New
and fill in your GitHub credentials. Paste the client ID from the OAuth
application you created into the Client ID field. Not connected
button to connect your application to GitHub.blog
and push it to GitHub. Under resource, choose File
, in operation, choose to Create
. Repository Owner
, in Repository Name
, put in the name of the GitHub repository you created. For File Path
, put in the name of your File, put in a commit message, and click on the Execute Node button.set
node to our workflow, which will set the value of the blog content agreed by the team. Add a set
node to your workflow by connecting it to your GitHub
node.Add value
button and choose String
from the drop-down. In the name property, fill in Blog_content
and the value property put in the blog content agreed by your team. When you click on the Execute Node button, notice that blog_content
is no longer empty. blog_content
in our Strapi application is still empty. To allow our changes reflect in our Strapi application, we need the Update Operation
of the Strapi node. Add another Strapi node to your workflow by connecting it to the second set
node.Operation
parameter to Update
, put in blogs as Content-Type
, leave the value of Update Key
as **id**
, and put in **Blog_content**
in Columns. Click on the Execute Node
button and notice how the blog item in our Strapi project has been updated.save
button. Flow
nodes like the IF
node, which will split a stream according to the instructions provided.n8n
can connect other nodes to the Strapi node according to your use case. n8n
has a trigger node that can listen to events and automatically start a workflow. With trigger nodes, It can activate your workflow without the need to click the Execute Workflow button.