Create a credential
In n8n, go to Credentials → Add Credential → Header Auth:
Create the key at platform.hcompany.ai/settings/api-keys. It’s shown once, and scoped to one organization.
Start a session
Add the Start Session node with Body Content Type set to JSON:
Request body
h/web-surfer-flash is a pre-built agent with its own browser, so you have nothing else to set up. To run your own agent, pass its name or an inline agent object (see Create a session). The response carries the session id:Response
Poll for completion
Add a Wait node (2 to 5 seconds, or 10 to 15 for tasks that run several minutes), then the Poll Status node, then an If node on
status:Status response
Import the full workflow
Paste this JSON onto an empty n8n canvas (or ⋯ menu → Import from clipboard) to get the nodes above, wired as a Wait, Poll Status, If loop. Then open each HTTP Request node and pick your own Header Auth credential: the placeholder credential ID won’t match your instance. Add a counter if you want a hard cap on polls.n8n workflow JSON
n8n workflow JSON
Event-driven alternative
Instead of polling, get a webhook when a session changes status. The same pattern works with Make, Zapier, Pipedream, or any tool that can make HTTP requests.1
Add a Webhook trigger node in n8n
Copy its Production URL.
2
Register the URL
Call Create webhook with that URL. Subscribe to
session.completed and session.failed, or to session.status_updated for every transition (see the event catalog).3
Handle the delivery
Each delivery is a signed
POST with session_id, status, and previous_status. The same event can arrive more than once: verify the signature, skip event ids you’ve already processed, and fetch the session for the authoritative state.