Callback url with token

How to set up callback url from facebook to n8n with verify token. unable to implement can anyone help

Hey @chandan988, this doesn’t look like an n8n screen. Are you simply trying to set up a webhook in an external system like Facebook? If so, you would need to check the respective documentation for exact setup instructructions.

On n8n side, you’d need a Webhook node, most likely configured to accept POST requests:

Keep in mind that the test URL is only active when manually executing your workflow and shows data right in the canvas. The production URL on the other hand is active whenever your workflow is active and would process data in the background (without data appearing immediately on the canvas).

First Screen was Facebook, We need to verify the token on n8n webhook and echo the custom output ( which which Facebook will send ), so unable to understand how to do this

Facebook says webhook to be in Get method so i used

Ah, could well be. I just figured the most common method is POST, so wanted to be sure to mention it. A custom response can be implemented as described in your other topic:

here we need to give output echo which i have marked with arrow

Yeah, sounds doable. You could use an expression like {{ $json.query["hub.challenge"] }} to read this value in the Set node from your other thread’s example workflow.

Set Node, but how to echo back the output ? which node to be used for that


i tried this but doesnot work

From looking at your workflow it does look like n8n responded though. You wouldn’t need the respond to Webhook node when using the example workflow as the initial webhook node is already configured to respond with the last node’s data.

Perhaps you can confirm which response format exactly you need? And which response you are currently sending?

just respond to the echo hub. challenge value i tried but its not working

Well, this suggests the response doesn’t quite match what your external service expects. Without knowing what exactly you need to send it’s really tough to suggest a solution though.

Perhaps you can share a link of the documentation to the service you’re trying to set up a webhook for?

So from reading Getting Started - Webhooks (facebook.com) it looks like there are two different types of requests.

  • Anytime you configure the Webhooks product in your App Dashboard, we’ll send a GET request to your endpoint URL. Verification requests include the following query string parameters, appended to the end of your endpoint URL.
  • When you configure your Webhooks product, you will subscribe to specific fields on an object type (e.g., the photos field on the user object). Whenever there’s a change to one of these fields, we will send your endpoint a POST request with a JSON payload describing the change.

So you’d need to create two separate webhook nodes, one for GET and one for POST requests.

As for the GET request, the documentation doesn’t describe the exact response format beyond

Respond with the hub.challenge value.

So I suppose they want that value and nothing else?

This could be achieved using a workflow like this:

Now the response body will contain the “hub.challenge” value and nothing else:

Thank you its done

1 Like

Awesome, thanks so much for confirming!