> ## Documentation Index
> Fetch the complete documentation index at: https://docs.altrina.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger a workflow

> Trigger a saved workflow by ID, optionally providing a free-form payload string.

The payload is interpreted by Altrina and mapped into the workflow's declared input parameters. If the workflow has no input parameters, you can omit the payload or send an empty body.

The response includes a `job_id` you can poll with `/v1/get_job_status/{job_id}` using the same API key.

Authenticate with either an Altrina API key or a Supabase session token in the `Authorization: Bearer` header.



## OpenAPI

````yaml POST /workflows/run-with-payload/{workflow_id}
openapi: 3.1.0
info:
  title: Altrina Browser Agent API
  description: >

    AI-powered browser automation API that allows you to control web browsers
    programmatically.


    ## What can Altrina do?


    Altrina uses advanced AI models to understand natural language instructions
    and execute them in a web browser:

    - **Web Scraping**: Extract data from any website without writing selectors

    - **Form Automation**: Fill out complex forms and multi-step workflows

    - **Testing**: Automated end-to-end testing with natural language assertions

    - **Research**: Gather information across multiple sites and compile results

    - **Monitoring**: Check websites for changes or specific conditions


    ## Authentication

    All API endpoints (except `/v1/health`) require authentication via API key.


    ### Getting an API Key

    1. Go to
    [https://app.altrina.com/settings](https://app.altrina.com/settings)

    2. Click on "Generate API Key"

    3. Copy your API key and keep it secure


    ### Using the API Key

    Include your API key in the `Authorization` header as a Bearer token:

    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ### Example cURL Request

    ```bash

    curl -X POST "https://api.altrina.com/v1/run_browser_agent" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "directive": "Go to news.ycombinator.com and get the titles and points of the top 3 stories on the homepage",
        "browser_config": {
          "width": 1920,
          "height": 1080,
          "residential_ip": false,
          "keep_browser_open": false,
          "use_user_browser_profile": false
        }
      }'
    ```


    **Note on Browser Profiles**: By default (`use_user_browser_profile:
    false`), each API call uses a fresh browser profile with no cookies or
    browsing history. Set `use_user_browser_profile: true` if you need to
    maintain logged-in state across multiple API calls.


    ## Rate Limits


    - **Browser Agent**: 10 requests/minute

    - **Status Polling**: 60 requests/minute

    - **Credit Balance**: 60 requests/minute


    ## Support


    For issues or questions, contact support@altrina.com
  version: 1.0.0
servers:
  - url: https://api.altrina.com
security: []
tags:
  - name: Browser Agent
    description: Start and monitor browser automation tasks
  - name: Workflows
    description: Trigger saved workflows via API or webhook
  - name: Account
    description: Manage credits and subscription
  - name: System
    description: Service health and status
paths:
  /workflows/run-with-payload/{workflow_id}:
    post:
      tags:
        - Workflows
      summary: Trigger a workflow
      description: >-
        Trigger a saved workflow by ID, optionally providing a free-form payload
        string.


        The payload is interpreted by Altrina and mapped into the workflow's
        declared input parameters. If the workflow has no input parameters, you
        can omit the payload or send an empty body.


        The response includes a `job_id` you can poll with
        `/v1/get_job_status/{job_id}` using the same API key.


        Authenticate with either an Altrina API key or a Supabase session token
        in the `Authorization: Bearer` header.
      operationId: run_workflow_with_payload
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              The workflow ID to trigger. Find this in the Studio URL (e.g.
              app.altrina.com/gallery/studio/{workflow_id}) or pre-filled in the
              webhook trigger modal.
            title: Workflow Id
          description: The workflow ID to trigger
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowPayloadRequest'
        required: false
      responses:
        '200':
          description: Workflow triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowTriggerResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not a member of the workflow's workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowPayloadRequest:
      properties:
        payload:
          anyOf:
            - type: string
            - type: 'null'
          title: Payload
          description: >-
            Free-form text that Altrina maps into the workflow's input
            parameters. Omit for workflows with no inputs.
      type: object
      title: WorkflowPayloadRequest
      description: Request body for triggering a workflow. The payload field is optional.
    WorkflowTriggerResponse:
      properties:
        status:
          type: string
          title: Status
          description: Always 'success' when the workflow is enqueued
        job_id:
          type: string
          title: Job Id
          description: Unique job identifier. Use this to poll /v1/get_job_status/{job_id}
        user_id:
          type: string
          title: User Id
          description: The authenticated user who triggered the workflow
        workflow_id:
          type: string
          title: Workflow Id
          description: The workflow that was triggered
        conversation_id:
          type: string
          title: Conversation Id
          description: Conversation identifier for this workflow run
      type: object
      required:
        - status
        - job_id
        - user_id
        - workflow_id
        - conversation_id
      title: WorkflowTriggerResponse
      description: Response returned when a workflow is successfully triggered.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Detailed error message
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code
      type: object
      required:
        - detail
        - status_code
      title: ErrorResponse
      description: Standard error response format
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        API key for authentication. Get your API key at
        https://app.altrina.com/settings
      scheme: bearer

````