Skip to content

feat(Airtop Node): Support running an agent with a specific browser profile#34933

Open
theogravity wants to merge 1 commit into
n8n-io:masterfrom
airtop-ai:airtop-run-agent-browser-profile
Open

feat(Airtop Node): Support running an agent with a specific browser profile#34933
theogravity wants to merge 1 commit into
n8n-io:masterfrom
airtop-ai:airtop-run-agent-browser-profile

Conversation

@theogravity

@theogravity theogravity commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Adds one option to the Airtop node's Run an agent operation and improves the node's test coverage. No new operations or dependencies are introduced.

New feature — Browser Profile ID on Run an agent
A workflow can now run a published agent against a specific browser profile instead of always using the agent's default. When the optional Browser Profile ID field is set, the identifier is sent to the agent webhook as a ?profileId= query parameter; when empty it's omitted and the agent's default profile is used. The value is trimmed and validated against the same alphanumeric-and-hyphen rule the Airtop API enforces, via a shared PROFILE_IDENTIFIER_REGEX that the existing session profile validation now also uses. Additive optional field; no node typeVersion bump.

Consistency — session profile field relabelled
The existing profile field on Create session, Save profile on termination, and the "automatically create session" mode of the extraction/interaction/window operations is relabelled Browser Profile ID. This is a display-label, description, and validation-message change only — the profileName parameter key and the outgoing API request are unchanged, so existing workflows keep working.

Test coverage (no behaviour change)

  • Adds unit tests for four existing operations that previously had none: Get live view, List windows, Load a file, Upload a file.
  • Expands the Run an agent unit tests.
  • Adds NodeTestHarness workflow tests for Run an agent (asserting the ?profileId= query param is sent when a Browser Profile ID is set and omitted when it isn't, including an await-execution + poll case), and for Get live view, List windows, Load a file, and Upload a file.

How to test

  1. Add an Airtop node, choose Agent → Run an agent, and select a published agent (add an Airtop credential if needed).
  2. Set Browser Profile ID to a saved browser profile identifier and run → the agent is invoked against that profile (the webhook request carries ?profileId=<id>).
  3. Leave Browser Profile ID empty and run → the agent uses its default profile (no profileId sent).
  4. Enter an invalid value such as bad profile! → the node raises a validation error before making any request.

Automated tests:

cd packages/nodes-base
pnpm test nodes/Airtop

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

🤖 Generated with Claude Code

@n8n-assistant

n8n-assistant Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

CLA Check passed. All contributors on this PR have signed the n8n CLA — thank you!

@theogravity
theogravity force-pushed the airtop-run-agent-browser-profile branch from ae8fcab to fbbbfda Compare July 24, 2026 18:53
@theogravity

Copy link
Copy Markdown
Author

/cla-check

@n8n-assistant n8n-assistant Bot added community Authored by a community member node/improvement New feature or request in linear DEPRECATED triage:pending Waiting to be triaged labels Jul 24, 2026
@n8n-assistant

n8n-assistant Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Hey @theogravity,

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach.

About review timelines:
This PR has been added to our internal tracker as "GHC-9083". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

@n8n-assistant n8n-assistant Bot added triage:in-progress Triage is in progress cla-signed and removed triage:pending Waiting to be triaged triage:in-progress Triage is in progress labels Jul 24, 2026
@theogravity
theogravity force-pushed the airtop-run-agent-browser-profile branch from fbbbfda to 21145de Compare July 24, 2026 19:55
@theogravity
theogravity marked this pull request as ready for review July 24, 2026 20:01
@theogravity

Copy link
Copy Markdown
Author

Companion documentation PR:

n8n-io/n8n-docs#5088

@theogravity

Copy link
Copy Markdown
Author

@cesars-gh FYI

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 21 files

Architecture diagram
sequenceDiagram
    participant WF as n8n Workflow Engine
    participant Node as Airtop Node (Run Agent)
    participant API as Airtop REST API
    participant Hooks as Airtop Hooks API

    Note over Node: NEW: Optional Browser Profile ID field

    WF->>Node: execute("agent", "run") with parameters
    Node->>Node: Read 'profileId' parameter, trim whitespace

    alt profileId is non-empty
        Node->>Node: Validate against PROFILE_IDENTIFIER_REGEX (alphanum + hyphens)
        alt Invalid (e.g. "bad profile!")
            Node-->>WF: Throw NodeOperationError('Browser Profile ID should only contain letters, numbers and dashes')
        else Valid
            Node->>API: GET /agents/{agentId} (get webhookId)
            API-->>Node: { webhookId }
            Node->>Node: Build invokeUrl = /agents/{agentId}/webhooks/{webhookId}
            Node->>Hooks: POST invokeUrl?profileId={trimmedProfileId} with agent parameters
            Hooks-->>Node: { invocationId }
            alt awaitExecution is true
                loop poll until completed or timeout
                    Node->>Hooks: GET /agents/{agentId}/invocations/{invocationId}/result
                    Hooks-->>Node: { status, output }
                end
            end
            Node-->>WF: Return execution data with invocationId (and output if awaited)
        end
    else profileId is empty
        Node->>API: GET /agents/{agentId} (get webhookId)
        API-->>Node: { webhookId }
        Node->>Node: Build invokeUrl = /agents/{agentId}/webhooks/{webhookId}
        Note over Node: No query param → uses agent's default profile
        Node->>Hooks: POST invokeUrl with agent parameters only
        Hooks-->>Node: { invocationId }
        alt awaitExecution is true
            loop poll until completed or timeout
                Node->>Hooks: GET /agents/{agentId}/invocations/{invocationId}/result
                Hooks-->>Node: { status, output }
            end
        end
        Node-->>WF: Return execution data
    end
Loading

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/nodes-base/nodes/Airtop/actions/agent/run.operation.ts Outdated
…ackfill tests

Squashed Airtop node changes (AIR-5022):
- Add an optional Browser Profile ID field to the agent Run operation; when set it's
  sent to the agent webhook as a ?profileId= query param, omitted otherwise.
- Extract a shared PROFILE_IDENTIFIER_REGEX used by both the agent field and the
  session profileName validation (matches the backend alphanum-hyphen rule).
- Relabel the session profile field to "Browser Profile ID" for consistency
  (display/validation text only; the profileName parameter key and API contract
  are unchanged, so existing workflows keep working).
- Add unit tests for the previously-untested getLiveView, list, load and upload
  operations and expanded agent run tests.
- Add NodeTestHarness workflow tests for the agent Run operation (asserting the
  ?profileId= query param), plus the window (get live view, list) and file
  (load, upload) operations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@theogravity
theogravity force-pushed the airtop-run-agent-browser-profile branch from 21145de to 87d2939 Compare July 24, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed community Authored by a community member in linear DEPRECATED node/improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant