Skip to main content
Computer-Use Agents work in n8n as a standard HTTP integration. There’s no custom node to install: you authenticate with a header, create a session, and either poll for the result or receive a webhook when it finishes.
1

Create a credential

In n8n, go to Credentials → Add Credential → Header Auth and set:Create the key at platform.hcompany.ai/settings/api-keys. It’s shown once, so copy it when you create it. A key is scoped to one organization.
2

Start a session

Add an HTTP Request node:Body:
Request body
h/web-surfer-flash is a built-in agent that comes with its own browser environment, so you can run a task without setting anything else up. To run your own agent, pass its name instead, or send an inline agent object; see Create a session for the full body.The response returns the session id you’ll use to poll for results:
Response
3

Poll for completion

Add a second HTTP Request node in a loop:Check the status field. The session is done when status is completed, failed, timed_out, or interrupted. Any other value (queued, pending, running, paused, idle, awaiting_tool_results) means it’s still going. Use an If node to branch on the status, and loop the “still running” branch back through a Wait node before hitting the status endpoint again. Two to five seconds is a good interval; back off to ten to fifteen for tasks that run several minutes.
Status response
4

Read the answer

The status endpoint tells you when the run is done, but it doesn’t carry the answer. Once the status is completed, add one more HTTP Request node to fetch the session and read latest_answer:The latest_answer field holds the agent’s final result.

Import the full workflow

Rather than build the four nodes by hand, copy the JSON below and paste it into an n8n canvas (⋯ menu → Import from clipboard, or just paste onto an empty canvas). It wires up the create, wait, poll, and read steps as a loop: the Wait node pauses a few seconds, Poll Status checks the state, and the If node either reads the answer (once the status is terminal) or loops back to wait. After importing, open each HTTP Request node and select your own Header Auth credential from step 1. The credential ID baked into the export won’t match your instance, so n8n shows the nodes as needing a credential until you pick yours.
The loop runs until the session reaches a terminal state; add a counter if you want a hard cap on the number of polls.

Event-driven alternative

Instead of polling, use Webhooks to get a callback when a session changes status. Add a Webhook trigger node in n8n, copy its Production URL, then register that URL for your organization with the Create webhook API. Subscribe to the events you care about, like session.completed and session.failed, or to session.status_updated for every transition (see the event catalog). n8n then receives a POST whenever a matching event fires, with session_id, status, and previous_status in the payload. Deliveries are signed and retried with backoff, so the same event can arrive more than once. Verify the signature (see Verifying deliveries), skip event ids you’ve already processed, and treat the webhook as a trigger: fetch the session for the authoritative state. The same pattern works with any tool that can make HTTP requests, such as Make, Zapier, Pipedream, or your own orchestrator.

Next steps

Create a session

The full session request body and options.

Session status

States, step count, and the polling pattern.

Webhooks

Signed callbacks on status changes, and how to verify them.

SDKs

The typed Python and TypeScript clients and the hai CLI.