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

# Create Workflow Run

> Trigger a new run of a workflow by configuration ID.

This creates a workflow run record and triggers the associated Prefect deployment
in fire-and-forget mode. The run status can be monitored via the get/list endpoints.

Headers:
- `Authorization`: Bearer token with JWT for authentication
- `X-Project-ID`: Project resource URI (e.g., 'proj:customer-analytics')

Optional:
- `asset_fqn`: Fully qualified name of the data asset (e.g., 'PostgreSQL.dvdrental.public.customer')
- `parameters`: Additional workflow execution parameters. For generate-table-description, use 'include' to specify a list of table FQNs to process.



## OpenAPI

````yaml /openapi/em-data-readiness-v2.yaml post /api/data-readiness/workflows/{configuration_id}/runs
openapi: 3.1.0
info:
  title: EM Data Readiness Service
  description: Data Readiness Service API for managing workflows, metrics, and data quality
  version: 4.3.0-dev1
servers: []
security:
  - BearerAuth: []
tags:
  - name: Health
    description: Service health monitoring. Check service status and version information.
  - name: Root
    description: Root endpoint providing service information and navigation links.
  - name: Configuration
    description: Service configuration endpoints. View current configuration values.
  - name: Workflows
    description: >-
      Workflow configuration and execution management. Create, configure, and
      run data quality workflows including definitions, configurations, runs,
      and tasks.
  - name: Data Assets
    description: >-
      Data catalog entity management. Manage databases, schemas, and tables
      metadata.
  - name: Metrics
    description: >-
      Data quality metrics and scorecards. Calculate scores, view trends, and
      analyze dimensions.
  - name: Violations
    description: >-
      Data quality violation management. View, acknowledge, and remediate
      detected violations.
  - name: Glossary
    description: >-
      Business glossary management. Create, verify, and organize business terms
      and definitions.
paths:
  /api/data-readiness/workflows/{configuration_id}/runs:
    post:
      tags:
        - Workflows
      summary: Create Workflow Run
      description: >-
        Trigger a new run of a workflow by configuration ID.


        This creates a workflow run record and triggers the associated Prefect
        deployment

        in fire-and-forget mode. The run status can be monitored via the
        get/list endpoints.


        Headers:

        - `Authorization`: Bearer token with JWT for authentication

        - `X-Project-ID`: Project resource URI (e.g., 'proj:customer-analytics')


        Optional:

        - `asset_fqn`: Fully qualified name of the data asset (e.g.,
        'PostgreSQL.dvdrental.public.customer')

        - `parameters`: Additional workflow execution parameters. For
        generate-table-description, use 'include' to specify a list of table
        FQNs to process.
      operationId: create_workflow_run
      parameters:
        - name: configuration_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Configuration ID
            examples:
              - 550e8400-e29b-41d4-a716-446655440001
            title: Configuration Id
          description: Configuration ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowRunCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunCreateResponse'
        '404':
          description: Configuration not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    WorkflowRunCreateRequest:
      properties:
        asset_fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Asset Fqn
          description: >-
            Fully qualified name of the data asset for the workflow run (e.g.,
            'PostgreSQL.dvdrental.public.customer').
          examples:
            - PostgreSQL.dvdrental.public
            - PostgreSQL.dvdrental.public.customer
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
          description: >-
            Workflow-specific execution parameters. See class docstring for
            available options per workflow type.
          examples:
            - include:
                - PostgreSQL.dvdrental.public.actor
                - PostgreSQL.dvdrental.public.film
              industry_info: E-commerce retail platform
            - industry_info: Banking
            - config:
                database: analytics
                parallel_workers: 10
                sample_data_limit: 5
        save_all:
          type: boolean
          title: Save All
          description: >-
            When true, workflow results are auto-saved without requiring manual
            approval.
          default: true
      type: object
      title: WorkflowRunCreateRequest
      description: >-
        Request body for creating/triggering a workflow run.


        The `parameters` field accepts workflow-specific options. Common
        parameters include:


        **Enrichment Workflows (generate-pii-tags, generate-table-description,
        enrich-table-columns):**

        - `include`: List of specific table FQNs to process (required for
        generate-table-description)

        - `industry_info`: Industry context for domain-specific enrichment
        (e.g., "Banking", "Healthcare", "E-commerce")


        **DQ Workflows (generate-dq-tags, generate-dq-rules, dq-execution):**

        - `industry_info`: Industry context for domain-specific tagging (e.g.,
        "Banking", "Healthcare") — generate-dq-tags only

        - `use_validation`: Whether to validate generated SQL rules (default:
        true) — generate-dq-rules only

        - Note: `resource_uri` and `database_type` are derived internally from
        the asset FQN, org_id, and project_id


        **Profiling Workflow:**

        - `config.profile_all_databases`: Profile all databases in the service

        - `config.database`: Single database name to profile

        - `config.parallel_workers`: Concurrent column queries per table
        (default: 10)

        - `config.sample_data_limit`: Number of sample values per column
        (default: 5)
      examples:
        - asset_fqn: PostgreSQL.dvdrental.public
          parameters:
            include:
              - PostgreSQL.dvdrental.public.actor
            industry_info: Banking and financial services
    WorkflowRunCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Created run identifier
          examples:
            - 123e4567-e89b-12d3-a456-426614174002
        configuration_id:
          type: string
          format: uuid
          title: Configuration Id
          description: Workflow configuration ID
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
        asset_fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Asset Fqn
          description: Fully qualified name of the data asset
          examples:
            - PostgreSQL.dvdrental.public.customer
        status:
          type: string
          title: Status
          description: Initial run status
          examples:
            - pending
        started_at:
          type: string
          title: Started At
          description: Run start timestamp (ISO 8601)
          examples:
            - '2024-01-15T10:30:00Z'
        save_all:
          type: boolean
          title: Save All
          description: >-
            Whether workflow results are auto-saved without requiring manual
            approval.
          default: true
          examples:
            - true
        pipeline_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Pipeline Id
          description: PipelineRun ID for run-all-enrichment orchestrator runs
        stripped_parameters:
          items:
            type: string
          type: array
          title: Stripped Parameters
          description: >-
            Parameter keys that were stripped before triggering the flow because
            the flow's Prefect schema does not declare them. Non-empty only when
            the caller passes parameters the flow ignores (e.g. 'include',
            'industry_info' for assessment flows). Empty list also when
            schema_fetch_skipped=True — see that field to distinguish.
        schema_fetch_skipped:
          type: boolean
          title: Schema Fetch Skipped
          description: >-
            True when the Prefect deployment schema could not be fetched due to
            a transient connectivity error and parameters were forwarded
            unchanged without filtering. When True, stripped_parameters is
            always empty even if the flow would have rejected some parameters.
          default: false
      type: object
      required:
        - id
        - configuration_id
        - status
        - started_at
      title: WorkflowRunCreateResponse
      description: Response for workflow run creation.
      example:
        asset_fqn: PostgreSQL.dvdrental.public.customer
        configuration_id: 123e4567-e89b-12d3-a456-426614174000
        id: 123e4567-e89b-12d3-a456-426614174002
        save_all: true
        schema_fetch_skipped: false
        started_at: '2024-01-15T10:30:00Z'
        status: pending
        stripped_parameters: []
      example_with_stripping:
        asset_fqn: PostgreSQL.dvdrental.public.customer
        configuration_id: 123e4567-e89b-12d3-a456-426614174000
        id: 123e4567-e89b-12d3-a456-426614174002
        save_all: true
        schema_fetch_skipped: false
        started_at: '2024-01-15T10:30:00Z'
        status: pending
        stripped_parameters:
          - include
          - industry_info
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorInfo'
          description: >-
            Error information object containing code, message, and optional
            details
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Request ID for debugging and support
          examples:
            - req_abc123xyz
      type: object
      required:
        - error
      title: ErrorResponse
      description: >-
        Standard error response model for API errors.


        Matches the structure returned by _handle_service_error in
        workflows/routes.py.

        The actual API response format is:

        {
            "error": {
                "code": "ERROR_CODE",
                "message": "Error message",
                "details": {...}
            },
            "request_id": "optional-request-id"
        }
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorInfo:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Error code identifier (e.g., 'WORKFLOW_NOT_FOUND',
            'VALIDATION_ERROR')
          examples:
            - WORKFLOW_NOT_FOUND
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - >-
              Workflow configuration with id
              '123e4567-e89b-12d3-a456-426614174000' not found
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Additional error details as a dictionary (flexible structure for
            business logic errors)
          examples:
            - workflow_id: 123e4567-e89b-12d3-a456-426614174000
      type: object
      required:
        - code
        - message
      title: ErrorInfo
      description: >-
        Nested error information object.


        Note: This model uses an untyped dict for `details` to match the
        flexible error

        structure used throughout the service layer (see WorkflowServiceError
        and similar).

        This is distinct from ErrorDetail, which is used for structured
        validation errors.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token authentication. Include the token in the Authorization
        header as: `Authorization: Bearer <token>`. The JWT must contain valid
        client_id, and project_id claims for tenant isolation and SDK routing.

````