Cursion DocsCursion Docs
Home
Dashboard
Home
Dashboard
  • Guides

    • Account
    • Billing
    • Selfhost
    • App
    • API
    • CLI
  • API

    • Site
    • Page
    • Scan
    • Test
    • Case
    • CaseRun
    • Flow
    • FlowRun
    • Issue
    • Schedule
    • Alert
    • Report
  • CLI

    • Site
    • Page
    • Scan
    • Test
    • Case
    • Flow

Flow

The Cursion CLI has 2 commands to work with the Flow object:

CommandDescription
run-flowrun a flow for a specific site
get-flowrunsget one or more flowruns

Tips

For information about the FlowRun object, please see FlowRun Overview.

Run a Flow

run-flow

This command will create a new FlowRun object for a Site object associated with the passed <site-id>. This command runs synchronously in the terminal and will resolve with a success message or raise an Exception if the resulting FlowRun.status is failed. Ideally, this command is designed for use in a CI/CD action - terminating the run if a FlowRun "fails".

The full command to run a FlowRun of a Site is the following:

cursion run-flow <site-id> <flow-id>
View Full Output
checking site availablity...
✔ site is available

starting new FlowRun

waiting for Run completion...
  2024-11-15 21:26:50.289730  |  system starting up for run_id: 38e1b4fa-c914-4d42-882d-7dff8cff27d4
  2024-11-15 21:26:50.296226  |  starting job ID: 1 | job type is [ SCAN ]
  2024-11-15 21:26:50.355330  |  starting 1 scans for https://example.com | run_id: 38e1b4fa-c914-4d42-882d-7dff8cff27d4
  2024-11-15 21:26:51.941134  |  starting lighthouse component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:26:52.717558  |  starting images (vrt) component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:26:54.938822  |  starting yellowlab component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:26:55.039284  |  starting html and logs component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:02.131316  |  completed yellowlab component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:03.924967  |  completed html and logs component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:07.567905  |  completed lighthouse component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:11.634143  |  completed images (vrt) component for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:15.485954  |  finished running all scan components for https://example.com | scan_id: f6a9f896-e200-43e4-820a-9cb32519464f
  2024-11-15 21:27:15.500849  |  starting job ID: 2 | job type is [ SLACK ]
  2024-11-15 21:27:17.421440  |  slack message sent successfully
  2024-11-15 21:27:17.431053  |  flowrun completed with status: ✅ PASSED

✔ flowrun completed -> 38e1b4fa-c914-4d42-882d-7dff8cff27d4

FlowRun results:
 ✔ Passed : https://app.cursion.dev/flowrun/38e1b4fa-c914-4d42-882d-7dff8cff27d4

Retrieve FlowRun

get-flowruns

This command will retrieve one or more FlowRun objects associated with the passed --site-id=<site-id> or --flowrun-id=<flowrun-id>.

The full command to retrieve a FlowRun is the following:

cursion get-flowruns --flowrun-id=<flowrun-id>
View Full Output
✔ Success
{
    "id": "c97021d2-dfd7-43ee-b9f5-136f49f3062d",
    "user": "dev@example.com",
    "account": "8d4075a8-5ba0-48c9-9735-b989595edad5",
    "flow": "cc5a0ede-1aff-4eff-8040-9f4c0783f043",
    "time_created": "2024-11-15T18:01:32.835728Z",
    "title": "Dual Step Flow",
    "nodes": [
        {
            "id": "1",
            "data": {
                "id": "1",
                "uri": "",
                "type": [
                    "html",
                    "logs",
                    "lighthouse",
                    "yellowlab",
                    "vrt"
                ],
                "email": "",
                "status": "queued",
                "case_id": null,
                "configs": {
                    "device": "Windows 10 PC",
                    "browser": "chrome",
                    "timeout": 300,
                    "interval": 1,
                    "location": "us",
                    "mask_ids": "",
                    "auto_height": true,
                    "end_on_fail": true,
                    "window_size": "1920,1080",
                    "create_issue": true,
                    "max_wait_time": 30,
                    "min_wait_time": 3,
                    "disable_animations": false
                },
                "headers": "{}",
                "message": "",
                "objects": [],
                "payload": "{}",
                "subject": "",
                "updates": null,
                "maxConds": 4,
                "maxNodes": 12,
                "parentId": null,
                "position": {
                    "x": 0,
                    "y": 0
                },
                "start_if": null,
                "finalized": false,
                "task_type": "scan",
                "threshold": 95,
                "conditions": null,
                "phone_number": "",
                "request_type": "GET",
                "time_started": null,
                "time_completed": null
            },
            "type": "basic",
            "measured": {
                "width": 272,
                "height": 48
            },
            "parentId": null,
            "position": {
                "x": 0,
                "y": 0
            }
        },
        {
            "id": "2",
            "data": {
                "id": "2",
                "uri": "",
                "type": [
                    "html",
                    "logs",
                    "lighthouse",
                    "yellowlab",
                    "vrt"
                ],
                "email": "",
                "status": "queued",
                "case_id": null,
                "configs": {
                    "device": "Windows 10 PC",
                    "browser": "chrome",
                    "timeout": 300,
                    "interval": 1,
                    "location": "us",
                    "mask_ids": null,
                    "auto_height": true,
                    "end_on_fail": true,
                    "window_size": "1920,1080",
                    "create_issue": true,
                    "max_wait_time": 30,
                    "min_wait_time": 3,
                    "disable_animations": false
                },
                "headers": "{}",
                "message": "This is a test message",
                "objects": [],
                "payload": "{}",
                "subject": "",
                "updates": null,
                "maxConds": 4,
                "maxNodes": 12,
                "parentId": "1",
                "position": {
                    "x": 0,
                    "y": 150
                },
                "start_if": null,
                "finalized": false,
                "task_type": "slack",
                "threshold": 95,
                "conditions": null,
                "phone_number": "",
                "request_type": "GET",
                "time_started": null,
                "time_completed": null
            },
            "type": "basic",
            "measured": {
                "width": 272,
                "height": 48
            },
            "parentId": "1",
            "position": {
                "x": 0,
                "y": 150
            }
        }
    ],
    "edges": [
        {
            "id": "1",
            "type": "smoothstep",
            "style": null,
            "source": "1",
            "target": "2",
            "animated": false
        }
    ],
    "status": "working",
    "time_completed": null,
    "logs": [
        {
            "timestamp": "2024-11-15 18:01:32.833712",
            "message": "system starting up for run_id: c97021d2-dfd7-43ee-b9f5-136f49f3062d",
            "step": "1"
        }
    ],
    "site": "f4f6e6c1-037f-45e4-8cf4-2979f12d2cf0",
    "configs": {
        "end_on_fail": true
    }
}

Last Updated:
Contributors: Landon
Prev
Case