Wait for a webhook

Hi guys.
I am creating a workflow. In that workflow, I need to wait for a webhook to fire and if the workflow fires action 1 happens and if it doesn’t, action 2 happens.
How can I implement this?
I would appreciate it if anyone can help me.

I’ve installed last version of n8n today.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @Mohammadali_Mo

What do you mean by saying “if doesn’t”?

If some error will occur or something else? You can configure the error workflow in the settings in order to capture any errors.

please share your workflow using the </> icon and pasting your code.

I also am not sure what you mean

Hi Liam. Thanks for answering me.
I will explain it better to you now:
I want to create a n8n workflow that:

  1. Starts executing
  2. Waits/pauses for an external webhook to be received
  3. Continues execution based on either:
  • The webhook was received within the waiting period → Execute Action 1
  • The webhook was NOT received within the waiting period → Execute Action 2

Does step 1 of your workflow trigger the 2nd step (waiting for the webhook)? So is it creating something then you’re waiting the the webhook to see when it’s ready, or something like that?

Let me know because the use case makes a difference.

What I would do considering the limited information is just create two workflows. The webhook just try triggers a second workflow entirely. To check if it was received within a range I would use the n8n searching and ifs that i supplied. You will need to ideally have the external webhook come back with a reference to the execution ID that called it. That way you can more reliably check the time of the first execution without needing to filter get requests (which you could do with some other identifiable info like an ID in the last step of the first step workflow)

Note: this will work as is with two triggers in one workflow but referencing workflow executions will likely be easier if they are separate, since each trigger will show up as a separate execution but would share the same workflow id.

Let me know if this helps

Thanks for your help and answer.
Here is the scenario that I want to happen for a user.
I have a course on my site and if a user finishes each lesson, a webhook can be called.
There are 3 lessons and I want to ensure users are reminded to watch each lesson.

Hi again. Here is the flowchart I want to implement.
I appreciate it if you could help me.

This use case would be better suited for a workflow on a schedule

For examples sake, lets say you want to send reminder emails every morning and afternoon and you want to remind people if it’s been more than 2 days since they last completed something.

I would use this workflow

You will need to change a lot about this workflow depending on what your site/cms is like, if it’s even possible. If it is possible to query that info and you need help making it work in the workflow, then feel free to share the json it returns and i’ll help you make it work

You should probably also add in some logic to make sure you aren’t sending people the same email twice every day if it’s past two days, so keep that in mind

let me know if this will work for you


Thanks, Liam. I got an idea from your demonstration and it worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.