Use n8n behind the scenes

We are thinking about using n8n as our integration engine behind the scenes in our service. Would it be possible to create and activate workflows via API?

what are the steps required to do something like this? what down side can you think of?

if we can make it work, it would be super cool as we can integrate with so many services on day one and for each service we add, we contribute back the code in n8n.io integrations!

To start off, welcome to the n8n community, @hadifarnoud! We hope you find your time here productive.

As to your questions, I firmly believe (if I am understanding you correctly) that what you are intending to do with n8n is exactly in line with n8n’s mission. To use a car analogy, if your entire network of systems and computers and IoT devices and online services are the vehicle that runs your business or organizations, then n8n is the transmission and gears and drive systems and pulleys that connect the engine to the tires to the steering wheel to the gas petal. Essentially n8n lets all of your separate systems work together as one cohesive machine.

As for setting this up for yourself, it can be as simple or as complex as you wish. For example, it could be nothing more than installing the n8n docker image on a preexisting windows system and having it monitor a log file that will send you an e-mail when it sees a specific event. Or, it can be as complicated as building a fully integrated IT environment that received data from hundred or thousands (or more) IoT, web service, operating system, mail, ERP, database, etc. endpoints and orchestrating a complex workflow to automate processes and system within you organization where historically you would have an army of people monitoring and reacting to events, adding in human error.

n8n allows you to let computers do what they are best at; talking to each other and performing common, repetitive tasks, leaving the interesting work such as being creative and innovative to people.

Now, you asks about downsides. As you are keenly aware, there are always negatives with any system and n8n is no exception. You or your team will need to be engages personally with n8n in order to reach your true potential with it. You will need to get a good understanding of the underlying technologies (TypeScript, Javascript, NodeJS, service APIs, etc.) along with your operating systems and services to determine how they can be integrated together using n8n.

You will also need to have a vision of what you want n8n to do for you, be able to determine where there may be gaps in the present n8n environment and be willing to put in the work to see your vision to fruition by building your own custom nodes and contributing these nodes to the rest of the community just as the community gave to you in the first place.

As for the process to getting something like this going, you’ve already taken the first steps by reaching out to the community. You have the opportunity to interact with professionals from around the world who have extensive technical and business backgrounds from almost every industry on the planet.

So, if you have not already, I would encourage you to take the following next steps:

  1. Find a small pilot project that you can work on that will produce useful, tangible results this week! It should be something easy that only needs a couple of integrations/nodes (see here for a list of the available integrations). If you need some inspiration, see some of the sample workflows that you can literally copy and paste into n8n, add your credentials (if needed) and have them up and running in minutes
  2. Find an advocate in management at your organization that shares your vision and present to them what you have done with n8n. Teach them the potential that n8n has for productivity and efficiency within the organization
  3. Map out areas that you can integrate together in the short term that will provide value immediately with n8n and areas that will require some work because the integrations/nodes are either not mature or are non-existent. This will help you create a roadmap for n8n within your organization
  4. Depending on the size of your organization, either get yourself (if you are a small organization) or your team (if you are a large organization) trained and skills in n8n and the underlying technologies.
  5. Share and engage with the n8n community. Let us know how we can help, your successes and failures, and ways we can all make n8n even better

I hope that answers a number of questions for you and helps you to set out a plan of action so that n8n can help your organization meet its potential. Don’t hesitate to reach out at anytime.

5 Likes

Hi @Tephlon thanks for such a descriptive explanation.

This is a great project and i am well versed in the stack being used.

I agree with you car and transmission analogy. but can i give our user this transmission to speed up their bi-cycles.
What i want to know is “Is there a way to create user separation in n8n?” ie. can i provide a link/or credentials to my current user where they can create workflows and they can store their workflow. but one users workflow does not show to the other.

Thank you @tephlon for your extensive answer.

Let me explain more. We are a SaaS startup (think of it as simpler Shopify). We want to integrate our platform with other services. the conventional way is writing all those integrations yourself.

I thought n8n could makes this process order of magnitude easier. However, I have two concerns.

  1. Can we use n8n behind the scenes (i.e. users don’t have to do anything different)?
    this means n8n should be useable with only API calls and it should be able to run those workflows for different users.

for example: imagine I have an online store. I want to get an email for every pending order. In our “App Store” I go ahead and activate the “App” (which is really a n8n workflow).

in this scenario, it would be like registering in n8n, activate that workflow, put your integration API keys or anything else that workflow needs, then it works. we want to not have these steps.

  1. is n8n capable of being backend of our “App Store”? For the most part, we want to use n8n for that and maybe only for small number of apps we have to write a custom app.

these were main part of my question that I didn’t find an answer to in your reply

thanks

Hey @Ashutosh_Raj
At this point, I do not believe that there is a way to run a single instance of n8n with multiple authenticated users all seeing their own flows only (but I could be wrong. @jan, would you be able to elaborate/confirm?)

But, because n8n is installed per user at an OS level, you could theoretically have unique users on the OS, each running their own instance of n8n on a separate port that they would need to authenticate into. This would then only show that user’s flows.

For example, if you had a company with employees that each wanted access to their own separate version of n8n and each employee had a 5 digit employee number, you could so the following:

  1. Create an n8n server with NodeJS installed globally (example.com)
  2. Create a user on the server for each employee
  3. Install n8n for each user user
  4. Customize each user’s n8n installation to use their employee ID and set authentication
  5. Instruct each user to go to their custom n8n installation at http://example.com:employeeID. So employee 54923 would go to http://example.com:54923

For bonus points, you could install an NGINX proxy in from of the n8n server and redirect http://employee.example.com to http://example.com:employeeID so Jim Nasium with employee ID 49721 would have http://example.com:49721 which would have NGINX redirect http://JimNasium.example.com to it.

1 Like

Hey @hadifarnoud.

Without knowing all the little details about your new business, I was tentatively say that yes, n8n would be able to handle the workflow for your new store with a few caveats:

  1. Build n8n to handle double your expected capacity. This is the typical engineer’s rule so that the service does not become a bottleneck and it can also handle spikes in traffic/usage.
  2. Make sure that you have a way of throttling/controlling the flow of information going to the n8n server. This is often handled using a message broker such as RabbitMQ or Kafka. This can most likely be handled by the AMQP Sender and AMQP Trigger integrations already built into n8n.
  3. Think carefully about how you want to engage n8n into your workflow. Do you want to use a message broker and accept requests as n8n gets to them? Do you want n8n to reach out to a service (or set of services) APIs on a schedule (e.g. every 15 minutes) and execute based on what it finds? Or should a webhook on n8n be set us so that other services can reach out to n8n and activate it in realtime? Or, do you use a combination of all three?
  4. Hope for the best but plan for the worst! Make sure that your n8n installation not only can handle the capacity that you need but that you also build in the robustness in your n8n solution so that it can deal with the problems that may occur. E.g. How does the system react to a crash? How will you secure n8n? Where will n8n live…production network, DMZ, cloud, other?

Hopefully that answers some of your questions and also gets you thinking a bit more about implementation and roll-out.

3 Likes

thank you very much @Tephlon. We will evaluate n8n and try to make it work. I think the effort is worth it.

Should we run into any issue,I would ask here.

That’s what we are here for! Good luck! :+1:

Thanks @Tephlon for the suggestion. i was also thinking of something similer.

Thanks a lot @Tephlon!

@hadifarnoud I just wanted to mention that if you make directly or indirectly money with using n8n, you would have to get a special license because of our fair-code license. So it is totally free if you use n8n internally for your company but if your customers would be charged to use n8n (which it sounds like if you want to use it behind the scenes as integration engine) then this would by default not be allowed.

You can find additional information about why we are doing that here:

1 Like

Thanks for the heads up @jan. Our integrations (apps) would be free to use but the service itself is not. It means that we are not making money directly from using n8n, but it does make the service more appealing.

This does not mean we would keep our integrations free. We will eventually add more local nodes to our n8n installation and will directly sell them to our customers. I assume this is 100% not allowed your fair-code license.

I’ll be in touch as soon as we started working on n8n integrations.

We are also trying to use n8n as internal company tools. ( It is very nice tool for our purpose! :grinning:)
We will make n8n container for each user to make their own workflow by providing url link ( diff by each users ) on our service page.
But there are some security issue. If the link is exposed to the other, it can be updated by the other(not owner).
So we are considering to make jwt auth func to n8n. When seeing the source it is seems like not to complete jwt auth. So if we complete it, it could be contribute? Or the n8n dev team has a plan to make the jwt func. Or am I misunderstanding and in fact jwt func is completed?
Thanks.

Welcome to the community @minukobba!

Even if you use an n8n instance for each user I would still at least activate basic auth with a custom user & password for each of them as described here:

JWT should already be fully implemented. There was also a discussion about it here:

Hope that helps!

1 Like

Thanks a lot for instant replying.

I read the BA Auth ( Introduction | Docs ). But we can’t use it because there are no session expire time.
The questions link is very helpful!
I am trying to edit the editor-ui package because I wanna use all n8n ui.
My plan is…

  1. make our service page give the user( already got jwt after sign-in ) a link to n8n ui with the jwt ( as parameter )
  2. edit n8n ui to inject the jwt at the request header ( every request to the restApi ) if some pre-defined parameter is given when reaching the n8n start page at first.
  3. I will make the pre-defined parameter customizable ( maybe on the config file )

Thanks!

Ah yes that sounds interesting @minukobba!

If you have something like that running please create a pull-request that we can check it out and maybe merge. In the mid- to long-term (sadly do not have an eta yet) will we add proper user-management which will then solve this problem.

1 Like

Hi,
I would like to know if there’s documentation on N8n own APIs ?
N8n APIs seems straightforward but a documentation would help a lot.

To use it behind the scene, I was wondering if N8n can be fully managed by an another App.
Typically, create few “template” workflows and reuse them by changing the endpoints/credentials/…

And last question, If I have well understood previous answers, to use N8n as a backend integration solution for customers for free, we have to not charge customers for that.

Regards,

1 Like

Welcome to the community @BJL!

No there is sadly no documentation. The reason is that it is really just an internal API and not to be officially used by anybody else except the n8n editor-UI. It did simply not get build for anything else and can so also change anytime. It is planned to add a proper public API to n8n in the future. As soon as it is available would we then also add documentation for it.

About the usage of n8n to integrate into a service is a little bit more complicated. If your service is totally free and you do not charge anybody anything, then it is OK and free for sure. If you however charge some people to use your service and only that people would get access to “n8n” it would be different. For that cases it is best to write to [email protected] and have a short chat.

1 Like