Java integration

Dear
how can I integrate between n8n work flow engine and our spring (java) application .
Thanks

Hi @Abdelrahman_Sayed, welcome to the community!

You could consider calling your n8n workflows via webhooks from your existing application. Check out the documentation on our Webhook node here: Webhook - n8n Documentation

Dear
do you have java app example calling n8n workflows via webhooks ?
I mean how can make my java app manage work flow ? . [ Java app start process and complete tasks]
Thanks about your response.

Dear
do you have java app example calling n8n workflows via webhooks ?

No, but it’s a simple http request send to n8n’s webhook URL. So something like this should do:

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://yourn8nurl/webhook/foo"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

You could use 3rd party tools such as Postman or Insomnia to build your request if you’re unsure, they come with options to export code for several different programming languages & libraries:

image

Java app start process and complete tasks

n8n would typically run in the background at all times waiting for webhooks (or other trigger events), so no need to start it from Java. Running workflows should work as described via webhooks :slight_smile:

As for management options you could take a look at your REST API using which you can create or edit your workflows for example: n8n public REST API | n8n Docs

There is no n8n SDK for Java, so all communication would have to take place via simple REST requests.

1 Like