How to Launch a Phantom from n8n Using HTTP Requests

Sophie
Sophie This badge shows you’re hearing straight from the source! Team members are here to share insider tips, answer questions, and guide you through PhantomBuster with expert knowledge. They’re dedicated to helping you succeed and making sure your automation journey feels easy and exciting. PhantomBuster Official
  • Updated

To launch a Phantom from n8n using an HTTP request, add an HTTP Request node to your workflow, set the method to POST, point it to the PhantomBuster /agents/launch endpoint, add your API key as an X-Phantombuster-Key header, and pass the Phantom ID and arguments as JSON in the request body. This method gives you full control over launch parameters and is ideal for advanced or customized workflows.

Before you start

  • Make sure the Phantom you want to launch is already created and set up in your PhantomBuster workspace.
  • With this method, you're launching an existing Phantom by sending it the input data it needs. You can adjust the data it uses for each run, but you'll need to set up the Phantom itself in PhantomBuster first.
  • You have a valid PhantomBuster API key
    → If you don't have one, see Create an API key. API keys can only be created by Workspace admins, if you don't see the Add API key button, check with your admin.

Workflows, like the LinkedIn Search to Lead Connection, can't currently be launched via API or n8n.

Step 1: Open or create a new workflow in n8n

  • Open n8n and log into your account.
  • From your dashboard, open an existing workflow or click New Workflow to start from scratch.
    n8n dashboard showing how to open or create a New Workflow

Step 2: Add a new HTTP Request node

  • Click the plus (+) icon, and in the search bar, type HTTP Request and select it from the list.
    n8n node search showing the HTTP Request node

Step 3: Configure the HTTP request to launch your Phantom

Set the API endpoint

  1. Go to the PhantomBuster API documentation, and find the endpoint under the PhantomBuster API V2 section, in the Agent dropdown: Click on /agents/launch.
    → This is what is used to start a Phantom.PhantomBuster API documentation showing the /agents/launch endpoint under Agent
  2. Copy the full endpoint URL and paste it into the URL field in your HTTP Request node.
    n8n HTTP Request node with the /agents/launch endpoint URL pasted into the URL field
  3. Set the HTTP method to POST. The default is GET, so make sure to update it before continuing.
    n8n HTTP Request node with the HTTP method set to POST

Enable headers and add your PhantomBuster API key

To authorize and format your HTTP request:

  1. Toggle Headers to ON.
  2. Add your header key as follows: X-Phantombuster-Key
    n8n HTTP Request node with Headers toggled on and the X-Phantombuster-Key header added
  3. Paste your PhantomBuster API key into the value field for the X-Phantombuster-Key header.
    n8n HTTP Request node showing the PhantomBuster API key in the X-Phantombuster-Key value field
  4. Click Add Parameter to create a second header, then enter the following:
    → Key: Content-Type
    → Value: application/json
    n8n HTTP Request node adding a second header with Content-Type set to application/json

Step 4: Set up the request body

In the HTTP Request node body section:

  1. Toggle on Send Body.
  2. Under Specify Body, choose Using JSON.
n8n HTTP Request node with Send Body toggled on and Specify Body set to Using JSON

Add your Phantom ID

In the JSON body, you'll first need to add the id field. This tells n8n which Phantom to launch.

  1. Start by typing the beginning of your JSON:
    { "id": 
    n8n HTTP Request JSON body showing the start of the id field
  2. Next, go to your PhantomBuster dashboard and find the Phantom you want to run:
    → Click on the Phantom to open its console, then look at the URL in your browser, and copy the long number that appears between /phantoms/ and /console:
    PhantomBuster console URL showing the Phantom ID between /phantoms/ and /console
  3. Back in your n8n workflow, paste that Phantom ID inside double quotes and add a comma at the end.
    n8n HTTP Request JSON body with the Phantom ID in double quotes followed by a comma

Keep the double quotes and comma in place, your JSON won't work without them.

Add your Phantom arguments

Now that your Phantom ID is in place, the next step is to tell n8n what data to send to the Phantom when it launches. You'll do this using the arguments field in your JSON.

  1. In your JSON body, right after the id line, add the following structure:
    "argument": {
    You'll paste your Phantom setup here in the next step
    }

    n8n HTTP Request JSON body showing the argument object added after the id field
  2. Then, go to your PhantomBuster dashboard and find the Phantom you want to run.
  3. Click the three dots in the top-right corner of the Phantom and select Setup.
    PhantomBuster Phantom three-dot menu showing the Setup option
  4. In the setup screen, click the three dots in the top-right of the input section, and select Switch to JSON.
    PhantomBuster Phantom setup showing Switch to JSON to copy the input JSON
  5. Copy the entire JSON structure shown: this contains the input data required to launch your Phantom.
  6. Back in your n8n workflow, paste the content into the argument field you created. Make sure everything is formatted correctly.
    → In our example, we're missing a closing bracket at the end. Go ahead and add it so your JSON looks complete.
    n8n HTTP Request JSON body showing the missing closing bracket added to the argument object

If you see a red warning in n8n, it usually means something small is missing, like a bracket or a comma. Check for extra or missing characters and try again.

Step 5: Execute the node

  • Click Execute step to launch your Phantom from within n8n.
    → n8n will send the setup you provided, just like if you had launched the Phantom manually from your PhantomBuster dashboard.
    n8n HTTP Request node showing the Execute step button to launch the Phantom

    n8n showing the HTTP Request step executed successfully
  • Once it runs, you'll be able to track the results right in your PhantomBuster workspace.
    PhantomBuster Activity tab showing the launch triggered from n8n

Troubleshoot API launch issues

If the Phantom doesn't launch or returns an error

  • Check that your PhantomBuster API key is valid and correctly added to the header.
  • Make sure your Phantom ID is accurate and wrapped in quotes.
  • Validate your JSON formatting in the argument field.
  • Confirm the Phantom has all required inputs (like a session cookie).
  • Launch the Phantom manually in PhantomBuster to confirm that your setup works before triggering it from n8n.
  • Get in touch with our Customer Care Team.

If you're trying to launch a Workflow

Workflows are designed to automatically relaunch based on their internal setup.
If activated, they'll trigger themselves; if deactivated, they won't start or pass data to the next step.

Because of this, Workflows can't be launched through API or n8n.

To achieve a similar result via n8n, we recommend chaining single Phantoms instead, for example:

You can launch each one separately within the same n8n workflow.
→ Copy each Phantom's input as JSON from its setup screen and use it to configure your n8n launch node.

Watch the video tutorial

Frequently asked questions

When should I use HTTP requests instead of the PhantomBuster integration node?

Use HTTP requests when you need full control over launch parameters, when the PhantomBuster integration node causes a "Missing cookie" error, or when you want to customize the request beyond what the built-in node supports.

What HTTP method and endpoint do I need?

Use a POST request to https://api.phantombuster.com/api/v2/agents/launch with your API key in the X-Phantombuster-Key header and Content-Type set to application/json.

Where do I find my Phantom ID?

Open the Phantom's console in your PhantomBuster Dashboard and look at the URL in your browser. The Phantom ID is the long number between /phantoms/ and /console.

Can I launch a Workflow this way?

No. Workflows can't be launched via API or n8n. Chain individual Phantoms in your n8n workflow instead.

Was this article helpful?

0 out of 0 found this helpful