-
Notifications
You must be signed in to change notification settings - Fork 5
Add Komos regulated browser ops template #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xuanli
wants to merge
1
commit into
ScraperNode:main
Choose a base branch
from
xuanli:add-komos-regulated-browser-ops-template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
templates/hr/komos-regulated-browser-ops-task-queue/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Komos Regulated Browser Ops Task Queue | ||
|
|
||
| > 0 views · [HR & Recruitment](../) | ||
|
|
||
| ## Description | ||
|
|
||
| This workflow receives a case payload in n8n, normalizes the regulated operations fields, and queues a [Komos](https://www.komos.ai/) browser automation task through the Komos public API. It is designed for CRA, banking, insurance, and HR operations teams that need to hand off portal-heavy work to a dedicated browser automation runner while keeping n8n as the orchestration layer. | ||
|
|
||
| ## Who it is for | ||
|
|
||
| - Background screening and CRA operations teams that need to check vendor or court portals. | ||
| - HR teams coordinating candidate background verification workflows. | ||
| - Insurance operations teams that need payer or eligibility portal work. | ||
| - Banking and finance operations teams that need browser workflows with audit-ready run metadata. | ||
|
|
||
| ## How it works | ||
|
|
||
| 1. `Receive Case` accepts a POST request from another n8n workflow, CRM, ATS, case system, or claims system. | ||
| 2. `Normalize Case` maps the incoming payload into a consistent Komos task input shape. | ||
| 3. `Queue Komos Task Run` calls `POST https://api.komos.ai/public/v1/tasks/{taskId}/runs` with a bearer API key. | ||
| 4. `Prepare Response` returns the Komos run response and the next operational step. | ||
| 5. `Respond to Webhook` sends a JSON response to the caller. | ||
|
|
||
| ## Setup | ||
|
|
||
| Set these n8n environment variables before running the workflow: | ||
|
|
||
| - `KOMOS_API_KEY`, your Komos organization API key. | ||
| - `KOMOS_TASK_ID`, the saved Komos task that performs the browser portal workflow. | ||
|
|
||
| Komos API docs: <https://docs.komos.ai/api-reference/introduction> | ||
|
|
||
| Background screening example: <https://www.komos.ai/solutions/hr> | ||
|
|
||
| ## Example webhook payload | ||
|
|
||
| ```json | ||
| { | ||
| "case_id": "CRA-2026-001", | ||
| "workflow_type": "background_screening_portal_check", | ||
| "industry": "background_screening", | ||
| "applicant_name": "Example Applicant", | ||
| "portal_url": "https://example-portal.local/cases/CRA-2026-001", | ||
| "review_required": true | ||
| } | ||
| ``` | ||
|
|
||
| ## Nodes Used | ||
|
|
||
| Webhook, Code, HTTP Request, Set, Respond to Webhook, Sticky Note | ||
|
|
||
| ## Import | ||
|
|
||
| Download [`workflow.json`](workflow.json) and import it into n8n: | ||
| **Workflow menu -> Import from File** | ||
|
|
||
| [Importing guide](../../../docs/importing-templates.md) · [Credential setup](../../../docs/credential-setup.md) |
202 changes: 202 additions & 0 deletions
202
templates/hr/komos-regulated-browser-ops-task-queue/workflow.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,202 @@ | ||
| { | ||
| "name": "Komos Regulated Browser Ops Task Queue", | ||
| "nodes": [ | ||
| { | ||
| "parameters": { | ||
| "httpMethod": "POST", | ||
| "path": "komos-regulated-browser-ops", | ||
| "responseMode": "responseNode", | ||
| "options": {} | ||
| }, | ||
| "id": "receive-case", | ||
| "name": "Receive Case", | ||
| "type": "n8n-nodes-base.webhook", | ||
| "typeVersion": 2, | ||
| "position": [ | ||
| 160, | ||
| 360 | ||
| ], | ||
| "webhookId": "komos-regulated-browser-ops" | ||
| }, | ||
| { | ||
| "parameters": { | ||
| "jsCode": "const body = $input.first().json.body || $input.first().json;\nconst taskId = $env.KOMOS_TASK_ID || body.task_id;\n\nif (!taskId) {\n throw new Error('Set KOMOS_TASK_ID in n8n or include task_id in the webhook payload.');\n}\n\nreturn [{\n json: {\n task_id: taskId,\n case_id: body.case_id || 'CRA-DEMO-001',\n workflow_type: body.workflow_type || 'background_screening_portal_check',\n industry: body.industry || 'background_screening',\n applicant_name: body.applicant_name || 'Example Applicant',\n portal_url: body.portal_url || 'https://example-portal.local/cases/CRA-DEMO-001',\n review_required: body.review_required ?? true\n }\n}];" | ||
| }, | ||
| "id": "normalize-case", | ||
| "name": "Normalize Case", | ||
| "type": "n8n-nodes-base.code", | ||
| "typeVersion": 2, | ||
| "position": [ | ||
| 420, | ||
| 360 | ||
| ] | ||
| }, | ||
| { | ||
| "parameters": { | ||
| "method": "POST", | ||
| "url": "={{ 'https://api.komos.ai/public/v1/tasks/' + $json.task_id + '/runs' }}", | ||
| "sendHeaders": true, | ||
| "headerParameters": { | ||
| "parameters": [ | ||
| { | ||
| "name": "Authorization", | ||
| "value": "={{ 'Bearer ' + $env.KOMOS_API_KEY }}" | ||
| }, | ||
| { | ||
| "name": "Content-Type", | ||
| "value": "application/json" | ||
| } | ||
| ] | ||
| }, | ||
| "sendBody": true, | ||
| "specifyBody": "json", | ||
| "jsonBody": "={\n \"clientRequestId\": \"n8n-{{ $json.case_id }}-{{ Date.now() }}\",\n \"inputs\": {\n \"case_id\": \"{{ $json.case_id }}\",\n \"workflow_type\": \"{{ $json.workflow_type }}\",\n \"applicant_name\": \"{{ $json.applicant_name }}\",\n \"portal_url\": \"{{ $json.portal_url }}\",\n \"review_required\": {{ $json.review_required }}\n },\n \"metadata\": {\n \"source\": \"n8n\",\n \"use_case\": \"regulated_browser_operations\",\n \"industry\": \"{{ $json.industry }}\"\n }\n}", | ||
| "options": {} | ||
| }, | ||
| "id": "queue-komos-task-run", | ||
| "name": "Queue Komos Task Run", | ||
| "type": "n8n-nodes-base.httpRequest", | ||
| "typeVersion": 4.2, | ||
| "position": [ | ||
| 700, | ||
| 360 | ||
| ], | ||
| "retryOnFail": true, | ||
| "maxTries": 2 | ||
| }, | ||
| { | ||
| "parameters": { | ||
| "assignments": { | ||
| "assignments": [ | ||
| { | ||
| "id": "status", | ||
| "name": "status", | ||
| "value": "queued", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "id": "komos_response", | ||
| "name": "komos_response", | ||
| "value": "={{ $json }}", | ||
| "type": "object" | ||
| }, | ||
| { | ||
| "id": "next_step", | ||
| "name": "next_step", | ||
| "value": "Review the Komos run history for browser actions, logs, and any human approval checkpoint.", | ||
| "type": "string" | ||
| } | ||
| ] | ||
| }, | ||
| "options": {} | ||
| }, | ||
| "id": "prepare-response", | ||
| "name": "Prepare Response", | ||
| "type": "n8n-nodes-base.set", | ||
| "typeVersion": 3.4, | ||
| "position": [ | ||
| 980, | ||
| 360 | ||
| ] | ||
| }, | ||
| { | ||
| "parameters": { | ||
| "respondWith": "json", | ||
| "responseBody": "={{ JSON.stringify($json) }}" | ||
| }, | ||
| "id": "respond-to-webhook", | ||
| "name": "Respond to Webhook", | ||
| "type": "n8n-nodes-base.respondToWebhook", | ||
| "typeVersion": 1.1, | ||
| "position": [ | ||
| 1220, | ||
| 360 | ||
| ] | ||
| }, | ||
| { | ||
| "parameters": { | ||
| "content": "## Komos Regulated Browser Ops Task Queue\n\nUse this template when a CRA, bank, insurance, or HR ops workflow needs browser portal work that should run outside n8n.\n\nSet these environment variables before running:\n\nKOMOS_API_KEY\nKOMOS_TASK_ID\n\nAPI docs: https://docs.komos.ai/api-reference/introduction\nBackground screening example: https://www.komos.ai/solutions/hr", | ||
| "height": 260, | ||
| "width": 380, | ||
| "color": 5 | ||
| }, | ||
| "id": "setup-note", | ||
| "name": "Setup Note", | ||
| "type": "n8n-nodes-base.stickyNote", | ||
| "typeVersion": 1, | ||
| "position": [ | ||
| 120, | ||
| 80 | ||
| ] | ||
| } | ||
| ], | ||
| "connections": { | ||
| "Receive Case": { | ||
| "main": [ | ||
| [ | ||
| { | ||
| "node": "Normalize Case", | ||
| "type": "main", | ||
| "index": 0 | ||
| } | ||
| ] | ||
| ] | ||
| }, | ||
| "Normalize Case": { | ||
| "main": [ | ||
| [ | ||
| { | ||
| "node": "Queue Komos Task Run", | ||
| "type": "main", | ||
| "index": 0 | ||
| } | ||
| ] | ||
| ] | ||
| }, | ||
| "Queue Komos Task Run": { | ||
| "main": [ | ||
| [ | ||
| { | ||
| "node": "Prepare Response", | ||
| "type": "main", | ||
| "index": 0 | ||
| } | ||
| ] | ||
| ] | ||
| }, | ||
| "Prepare Response": { | ||
| "main": [ | ||
| [ | ||
| { | ||
| "node": "Respond to Webhook", | ||
| "type": "main", | ||
| "index": 0 | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| }, | ||
| "active": false, | ||
| "settings": { | ||
| "executionOrder": "v1", | ||
| "saveManualExecutions": true | ||
| }, | ||
| "tags": [ | ||
| { | ||
| "name": "Komos", | ||
| "id": "komos" | ||
| }, | ||
| { | ||
| "name": "Regulated Ops", | ||
| "id": "regulated-ops" | ||
| }, | ||
| { | ||
| "name": "Browser Automation", | ||
| "id": "browser-automation" | ||
| } | ||
| ], | ||
| "meta": { | ||
| "instanceId": "komos-regulated-browser-ops-v1", | ||
| "description": "Queues a Komos browser automation task run from n8n for CRA, banking, insurance, and HR operations." | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Queue Komos Task Runnode constructsjsonBodyby interpolating payload fields into a raw JSON string, which is fragile for real inputs: values likeapplicant_nameorportal_urlcontaining quotes/newlines can produce invalid JSON and cause the request to fail at runtime with JSON-format errors. This should be sent as a full object expression (for example={{ {...} }}) so n8n performs proper escaping and preserves types reliably.Useful? React with 👍 / 👎.