Integrate with n8n #1249

Closed
opened 2022-09-07 23:04:04 +00:00 by xeruf · 16 comments

I remember talking about generalized integrations and something like webhooks, but could not find the discussion.
I have not used https://n8n.io yet, but it seems like a good fit here since it is essentially a self-hostable IFTTT/Zapier alternative.

When it comes to internal hooks, Wekan is a comparable alternative though it tends to be a bit clunky, but I think Zammad does a good job with it:
image

For example, I would like to assign the task creator to a task by default if he does not set an assignee initially. Currently our tasks are quite messy because it is a hassle to assign yourself to each task you create, so most are unassigned...

I remember talking about generalized integrations and something like webhooks, but could not find the discussion. I have not used https://n8n.io yet, but it seems like a good fit here since it is essentially a self-hostable IFTTT/Zapier alternative. When it comes to internal hooks, Wekan is a comparable alternative though it tends to be a bit clunky, but I think Zammad does a good job with it: ![image](/attachments/680c05e1-9e1f-49d2-a7d6-b6b223da6a59) For example, I would like to assign the task creator to a task by default if he does not set an assignee initially. Currently our tasks are quite messy because it is a hassle to assign yourself to each task you create, so most are unassigned...
Author

I would like to assign the task creator to a task by default if he does not set an assignee initially.

@kolaente this is a priority feature, would you think implementing a proper integration is feasible, or should this be bolted on for now?

> I would like to assign the task creator to a task by default if he does not set an assignee initially. @kolaente this is a priority feature, would you think implementing a proper integration is feasible, or should this be bolted on for now?
konrad changed title from Integrate with https://n8n.io to Integrate with n8n.io 2022-09-23 04:09:13 +00:00
konrad added the
kind/feature
label 2022-09-23 04:09:33 +00:00
Owner

If your priority is to have an option for automatically assign a user to a task when not assigning someone from the start that could be done faster by adding an option in Vikunja for that.

If you only want to assign the user if they create a task without assigning someone you could already do that with n8n right now. It's just not very comfortable.

It would go something like this:

  1. Log in into Vikunja in a browser and copy the token you get from local storage or add a node which uses a username and password to obtain a token.
  2. Create a cron job in n8n which checks every now and then if there are any new tasks since the last check without an assignee
  3. For all tasks found, assign the creator of the task

I've attached a workflow that should do exactly that.

A proper n8n integration is a lot more complicated and can actually be divided into three parts:

  1. Proper webhooks in Vikunja to notify third-party services like n8n when something happens in Vikunja (like creating a new task)
  2. Scoped API tokens in Vikunja. Right now it's only possible to log in as a user and use its token to talk to the Vikunja API. This could be used in an integration like n8n but it's a bit clumsy having to replace the token every now and then (they expire after a while). Creating, scoping and revoking long-lived tokens like GitHub does it would be a lot more comfortable.
  3. Pre-define Vikunja-related tasks in n8n, like they already have for a bunch of services. Even with the first two items implemented you'd still need to send API requests manually from within n8n (they have nodes for sending http requests). If tasks were pre-defined you could just use the "add assignee" task and be done with it.
If your priority is to have an option for automatically assign a user to a task when not assigning someone from the start that could be done faster by adding an option in Vikunja for that. If you only want to assign the user if they create a task without assigning someone you could already do that with n8n right now. It's just not very comfortable. It would go something like this: 1. Log in into Vikunja in a browser and copy the token you get from local storage or add a node which uses a username and password to obtain a token. 2. Create a cron job in n8n which checks every now and then if there are any new tasks since the last check without an assignee 3. For all tasks found, assign the creator of the task I've attached a workflow that should do exactly that. A proper n8n integration is a lot more complicated and can actually be divided into three parts: 1. Proper webhooks in Vikunja to notify third-party services like n8n when something happens in Vikunja (like creating a new task) 2. Scoped API tokens in Vikunja. Right now it's only possible to log in as a user and use its token to talk to the Vikunja API. This could be used in an integration like n8n but it's a bit clumsy having to replace the token every now and then (they expire after a while). Creating, scoping and revoking long-lived tokens like GitHub does it would be a lot more comfortable. 3. Pre-define Vikunja-related tasks in n8n, like they already have for a bunch of services. Even with the first two items implemented you'd still need to send API requests manually from within n8n (they have nodes for sending http requests). If tasks were pre-defined you could just use the "add assignee" task and be done with it.
Author

Thank you for the detailed analysis, I will reconsider!

Thank you for the detailed analysis, I will reconsider!
Author

A full n8n integration is really what we want.
n8n already has integrations for discourse, zulip, invoiceninja, zammad and many more - so with this we can really implement our polygon connections!

Imagine writing a message in Discourse or Gitea which triggers a task creation in your backlog including a backlink to the thread, syncing tasks from vikunja to the time-tracking tool and reporting back when they are done, and so much more :)

A full n8n integration is really what we want. n8n already has integrations for [discourse](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.discourse/), zulip, invoiceninja, zammad and many more - so with this we can really implement our polygon connections! Imagine writing a message in Discourse or Gitea which triggers a task creation in your backlog including a backlink to the thread, syncing tasks from vikunja to the time-tracking tool and reporting back when they are done, and so much more :)
xeruf changed title from Integrate with n8n.io to Integrate with n8n 2023-01-04 04:22:35 +00:00

Since the Vikunja API is so well developed, integration with n8n would really open up doors to fantastic integrations!

Since the Vikunja API is so well developed, integration with n8n would really open up doors to fantastic integrations!

If your priority is to have an option for automatically assign a user to a task when not assigning someone from the start that could be done faster by adding an option in Vikunja for that.

If you only want to assign the user if they create a task without assigning someone you could already do that with n8n right now. It's just not very comfortable.

It would go something like this:

  1. Log in into Vikunja in a browser and copy the token you get from local storage or add a node which uses a username and password to obtain a token.
  2. Create a cron job in n8n which checks every now and then if there are any new tasks since the last check without an assignee
  3. For all tasks found, assign the creator of the task

I've attached a workflow that should do exactly that.

A proper n8n integration is a lot more complicated and can actually be divided into three parts:

  1. Proper webhooks in Vikunja to notify third-party services like n8n when something happens in Vikunja (like creating a new task)
  2. Scoped API tokens in Vikunja. Right now it's only possible to log in as a user and use its token to talk to the Vikunja API. This could be used in an integration like n8n but it's a bit clumsy having to replace the token every now and then (they expire after a while). Creating, scoping and revoking long-lived tokens like GitHub does it would be a lot more comfortable.
  3. Pre-define Vikunja-related tasks in n8n, like they already have for a bunch of services. Even with the first two items implemented you'd still need to send API requests manually from within n8n (they have nodes for sending http requests). If tasks were pre-defined you could just use the "add assignee" task and be done with it.

Thanks for sharing that workflow ! Although I agree with you, that this should come from a native Vikunja option. It actually has been a pain with my teammates that we have to manually assign ourselves to tasks that we create instead of it assign us automatically if we assign other people.

> If your priority is to have an option for automatically assign a user to a task when not assigning someone from the start that could be done faster by adding an option in Vikunja for that. > > If you only want to assign the user if they create a task without assigning someone you could already do that with n8n right now. It's just not very comfortable. > > It would go something like this: > > 1. Log in into Vikunja in a browser and copy the token you get from local storage or add a node which uses a username and password to obtain a token. > 2. Create a cron job in n8n which checks every now and then if there are any new tasks since the last check without an assignee > 3. For all tasks found, assign the creator of the task > > I've attached a workflow that should do exactly that. > > A proper n8n integration is a lot more complicated and can actually be divided into three parts: > > 1. Proper webhooks in Vikunja to notify third-party services like n8n when something happens in Vikunja (like creating a new task) > 2. Scoped API tokens in Vikunja. Right now it's only possible to log in as a user and use its token to talk to the Vikunja API. This could be used in an integration like n8n but it's a bit clumsy having to replace the token every now and then (they expire after a while). Creating, scoping and revoking long-lived tokens like GitHub does it would be a lot more comfortable. > 3. Pre-define Vikunja-related tasks in n8n, like they already have for a bunch of services. Even with the first two items implemented you'd still need to send API requests manually from within n8n (they have nodes for sending http requests). If tasks were pre-defined you could just use the "add assignee" task and be done with it. Thanks for sharing that workflow ! Although I agree with you, that this should come from a native Vikunja option. It actually has been a pain with my teammates that we have to manually assign ourselves to tasks that we create instead of it assign us automatically if we assign other people.
Author

How is the state of development for n8n?

How is the state of development for n8n?
Owner

I've started with the development of the proper api keys today.

I've started with the development of the proper api keys today.
Owner

API Tokens are done now:

vikunja/api#1600
vikunja/frontend#3733

API Tokens are done now: https://kolaente.dev/vikunja/api/pulls/1600 https://kolaente.dev/vikunja/frontend/pulls/3733
Owner

This is done now: https://vikunja.io/docs/n8n/

This is done now: https://vikunja.io/docs/n8n/
Author

For example, I would like to assign the task creator to a task by default if he does not set an assignee initially. Currently our tasks are quite messy because it is a hassle to assign yourself to each task you create, so most are unassigned...

Can you outline how this would work with the new n8n integration? Seems I still have to use a webhook :c

> For example, I would like to assign the task creator to a task by default if he does not set an assignee initially. Currently our tasks are quite messy because it is a hassle to assign yourself to each task you create, so most are unassigned... Can you outline how this would work with the new n8n integration? Seems I still have to use a webhook :c
Author

and it seems I have to create the webhook for every project :c

and it seems I have to create the webhook for every project :c
Owner

Yeah you will need to use a webhook, there's no way for n8n to get notified of events otherwise.

Yeah you will need to use a webhook, there's no way for n8n to get notified of events otherwise.
Author

yeah but it would be nice to have a user-wide webhook so that I can implement a flow for all my projects, or at least have it be recursive including subprojects

yeah but it would be nice to have a user-wide webhook so that I can implement a flow for all my projects, or at least have it be recursive including subprojects
Owner

Making it recursive could work.

Making it recursive could work.
Owner

Webhooks will now fire for any webhook set in a parent project (8c826c44d2). Please check with the next unstable build.

Webhooks will now fire for any webhook set in a parent project (8c826c44d2684538d7b59c12bfbe74c6ce6d8bf5). Please check with the next unstable build.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1249
No description provided.