Validere workflow_templates API

Workflow Templates

OpenAPI Specification

validere-workflow-templates-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  description: Activity Log
  title: CarbonHub activities workflow_templates API
  version: 1.0.0
servers:
- url: https://api.validere.io
security:
- Staging: []
- Integration: []
- Local: []
tags:
- description: Workflow Templates
  name: workflow_templates
paths:
  /app/v1/workflow_templates:
    post:
      operationId: create_workflow_template
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ICreateWorkflowTemplateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IWorkflowTemplate'
          description: A successful operation
      summary: Create a Workflow Template
      tags:
      - workflow_templates
  /app/v1/workflow_templates/search:
    post:
      operationId: search_workflow_templates
      requestBody:
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Paginated'
              - $ref: '#/components/schemas/WorkflowTemplateSort'
              - $ref: '#/components/schemas/WorkflowTemplateFilter'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedWorkflowTemplateList'
          description: Successfully operation
      summary: Search Workflow Templates
      tags:
      - workflow_templates
  /app/v1/workflow_templates/{id}:
    get:
      operationId: get_workflow_template
      parameters:
      - $ref: '#/components/parameters/WorkflowTemplateId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/IWorkflowTemplate'
                - type: object
                  properties:
                    facility_filter:
                      $ref: '#/components/schemas/FacilityFilterFields'
          description: A successful operation
      summary: Get a workflow template
      tags:
      - workflow_templates
    put:
      operationId: put_workflow_template
      parameters:
      - $ref: '#/components/parameters/WorkflowTemplateId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IUpdateWorkflowTemplateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IWorkflowTemplate'
          description: A successful operation
      summary: Update a workflow template
      tags:
      - workflow_templates
    delete:
      operationId: delete_workflow_template
      parameters:
      - $ref: '#/components/parameters/WorkflowTemplateId'
      responses:
        '200':
          description: A successful operation
      summary: Delete a workflow template
      tags:
      - workflow_templates
components:
  schemas:
    IWorkflowTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        category_id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 1024
        version:
          type: integer
        status:
          type: string
          enum:
          - archive
          - draft
          - active
        triggers:
          type: array
          items:
            anyOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                  - scheduled
                due_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                    start_variable:
                      type: string
                  required:
                  - time_period
                  - duration
                notification_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                  - time_period
                  - duration
                output:
                  type: object
                  additionalProperties:
                    anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^\$.*$
                      description: path must be a JSON path to specify the JSON fields starting with $
                      example: $.answers.section1[0].question_leak.value
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^(?!\$).*$
                      description: static value ​​cannot start with $
                      example: foo
                  description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                  example:
                    $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                    $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                    $ASSOCIATED_ASSET_ID: $.asset.id
                    $ASSOCIATED_ASSET_NAME: $.asset.name
                    $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                    $FOO: bar
                cron:
                  type: string
                  description: https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchevents-expressions.html
                  example: 0 8 * * ? *
              required:
              - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                  - system
                due_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                    start_variable:
                      type: string
                  required:
                  - time_period
                  - duration
                notification_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                  - time_period
                  - duration
                output:
                  type: object
                  additionalProperties:
                    anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^\$.*$
                      description: path must be a JSON path to specify the JSON fields starting with $
                      example: $.answers.section1[0].question_leak.value
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^(?!\$).*$
                      description: static value ​​cannot start with $
                      example: foo
                  description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                  example:
                    $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                    $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                    $ASSOCIATED_ASSET_ID: $.asset.id
                    $ASSOCIATED_ASSET_NAME: $.asset.name
                    $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                    $FOO: bar
                event:
                  type: string
                  enum:
                  - form_submission_create
                form_schema_id:
                  type: string
                  format: uuid
                answer_filter:
                  anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      submission_id:
                        type: string
                        format: uuid
                      section_id:
                        type: string
                      question_index:
                        type: integer
                      question_id:
                        type: string
                      answer.value:
                        anyOf:
                        - type: string
                        - type: number
                        - nullable: true
                        - nullable: true
                    required:
                    - question_id
                  - type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        submission_id:
                          type: string
                          format: uuid
                        section_id:
                          type: string
                        question_index:
                          type: integer
                        question_id:
                          type: string
                        answer.value:
                          anyOf:
                          - type: string
                          - type: number
                          - nullable: true
                          - nullable: true
                      required:
                      - question_id
              required:
              - type
              - event
              - form_schema_id
            - type: object
              properties:
                type:
                  type: string
                  enum:
                  - system
                due_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                    start_variable:
                      type: string
                  required:
                  - time_period
                  - duration
                notification_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                  - time_period
                  - duration
                output:
                  type: object
                  additionalProperties:
                    anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^\$.*$
                      description: path must be a JSON path to specify the JSON fields starting with $
                      example: $.answers.section1[0].question_leak.value
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^(?!\$).*$
                      description: static value ​​cannot start with $
                      example: foo
                  description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                  example:
                    $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                    $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                    $ASSOCIATED_ASSET_ID: $.asset.id
                    $ASSOCIATED_ASSET_NAME: $.asset.name
                    $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                    $FOO: bar
                event:
                  type: string
                  enum:
                  - asset_create
                asset_type:
                  type: string
                  enum:
                  - asset_group
                  - facility
                  - equipment
                  - device
                  - flow
                asset_filter:
                  type: object
                  additionalProperties:
                    nullable: true
              required:
              - type
              - event
              - asset_type
              - asset_filter
            - type: object
              properties:
                type:
                  type: string
                  enum:
                  - system
                due_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                    start_variable:
                      type: string
                  required:
                  - time_period
                  - duration
                notification_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                  - time_period
                  - duration
                output:
                  type: object
                  additionalProperties:
                    anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^\$.*$
                      description: path must be a JSON path to specify the JSON fields starting with $
                      example: $.answers.section1[0].question_leak.value
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^(?!\$).*$
                      description: static value ​​cannot start with $
                      example: foo
                  description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                  example:
                    $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                    $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                    $ASSOCIATED_ASSET_ID: $.asset.id
                    $ASSOCIATED_ASSET_NAME: $.asset.name
                    $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                    $FOO: bar
                event:
                  type: string
                  enum:
                  - asset_update
                asset_type:
                  type: string
                  enum:
                  - asset_group
                  - facility
                  - equipment
                  - device
                  - flow
                asset_filter:
                  type: object
                  additionalProperties:
                    nullable: true
                attributes:
                  type: array
                  items:
                    type: string
                  default: []
              required:
              - type
              - event
              - asset_type
              - asset_filter
            - type: object
              properties:
                type:
                  type: string
                  enum:
                  - system
                due_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                    start_variable:
                      type: string
                  required:
                  - time_period
                  - duration
                notification_date:
                  type: object
                  properties:
                    time_period:
                      type: string
                      enum:
                      - hours
                      - days
                      - weeks
                      - months
                    duration:
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                  - time_period
                  - duration
                output:
                  type: object
                  additionalProperties:
                    anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^\$.*$
                      description: path must be a JSON path to specify the JSON fields starting with $
                      example: $.answers.section1[0].question_leak.value
                    - type: string
                      minLength: 1
                      maxLength: 1024
                      pattern: ^(?!\$).*$
                      description: static value ​​cannot start with $
                      example: foo
                  description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                  example:
                    $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                    $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                    $ASSOCIATED_ASSET_ID: $.asset.id
                    $ASSOCIATED_ASSET_NAME: $.asset.name
                    $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                    $FOO: bar
                event:
                  type: string
                  enum:
                  - workflow_complete
                workflow_template_id:
                  type: string
                  format: uuid
              required:
              - type
              - event
              - workflow_template_id
            example:
              type: system
              event: asset_create
              asset_type: equipment
              due_date:
                time_period: hours
                duration: 0
              asset_filter:
                type: acid_gas_removal
                custom_attributes.attribute1: 12345
                facility_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        config:
          type: object
          properties:
            start:
              type: string
            steps:
              type: object
              additionalProperties:
                anyOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                      - system_action
                    name:
                      type: string
                      maxLength: 256
                    description:
                      type: string
                      maxLength: 1024
                    next:
                      type: string
                    end:
                      type: boolean
                    task:
                      anyOf:
                      - type: object
                        properties:
                          output:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^\$.*$
                                description: path must be a JSON path to specify the JSON fields starting with $
                                example: $.answers.section1[0].question_leak.value
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                            example:
                              $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                              $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                              $ASSOCIATED_ASSET_ID: $.asset.id
                              $ASSOCIATED_ASSET_NAME: $.asset.name
                              $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                              $FOO: bar
                          input:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 3
                                maxLength: 64
                                pattern: ^\$[A-Z]+[A-Z_0-9]+
                                description: variable name must start with $ and use only uppercase letters, digits and the dash character, variable name must not start with $VALIDERE, reserved namespace
                                example: $TRIGGERING_ASSET_NAME
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for accessing workflow variables. Value accept static value or a Variable name
                            example:
                              $.description: foo
                              $.questions.question_leak.default_answer: $LEAK_EQUIPMENT
                          type:
                            type: string
                            enum:
                            - create_event
                          event_schema_id:
                            type: string
                            format: uuid
                          event_status:
                            type: string
                            enum:
                            - open
                            - resolved
                            - overdue
                            - dismissed
                        required:
                        - type
                        - event_schema_id
                        - event_status
                      - type: object
                        properties:
                          output:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^\$.*$
                                description: path must be a JSON path to specify the JSON fields starting with $
                                example: $.answers.section1[0].question_leak.value
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                            example:
                              $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                              $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                              $ASSOCIATED_ASSET_ID: $.asset.id
                              $ASSOCIATED_ASSET_NAME: $.asset.name
                              $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                              $FOO: bar
                          input:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 3
                                maxLength: 64
                                pattern: ^\$[A-Z]+[A-Z_0-9]+
                                description: variable name must start with $ and use only uppercase letters, digits and the dash character, variable name must not start with $VALIDERE, reserved namespace
                                example: $TRIGGERING_ASSET_NAME
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for accessing workflow variables. Value accept static value or a Variable name
                            example:
                              $.description: foo
                              $.questions.question_leak.default_answer: $LEAK_EQUIPMENT
                          type:
                            type: string
                            enum:
                            - form_choice
                          form_schema_id:
                            type: string
                            format: uuid
                          choices:
                            type: array
                            items:
                              type: object
                              properties:
                                answer_filter:
                                  type: object
                                  additionalProperties:
                                    nullable: true
                                  description: an array of answer filters is similar to an and operation which will match answers with a common section_id and section_index. filter must contain question_id and answer to make the condition meaningful
                                next:
                                  type: string
                              required:
                              - answer_filter
                              - next
                            minItems: 1
                            maxItems: 8
                        required:
                        - type
                        - form_schema_id
                        - choices
                      - type: object
                        properties:
                          output:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^\$.*$
                                description: path must be a JSON path to specify the JSON fields starting with $
                                example: $.answers.section1[0].question_leak.value
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for storing workflow variables. Value accept static value or a JSON path starting with $
                            example:
                              $TRIGGERING_ASSET_ID: $.asset_trigger.metadata.id
                              $LEAK_EQUIPMENT: $.answers.section1[0].question_leak.value
                              $ASSOCIATED_ASSET_ID: $.asset.id
                              $ASSOCIATED_ASSET_NAME: $.asset.name
                              $ASSOCIATED_ASSET_TYPE: $.asset.asset_type
                              $FOO: bar
                          input:
                            type: object
                            additionalProperties:
                              anyOf:
                              - type: string
                                minLength: 3
                                maxLength: 64
                                pattern: ^\$[A-Z]+[A-Z_0-9]+
                                description: variable name must start with $ and use only uppercase letters, digits and the dash character, variable name must not start with $VALIDERE, reserved namespace
                                example: $TRIGGERING_ASSET_NAME
                              - type: string
                                minLength: 1
                                maxLength: 1024
                                pattern: ^(?!\$).*$
                                description: static value ​​cannot start with $
                                example: foo
                            description: key-value pairs for accessing workflow variables. Value accept static value or a Variable name
                            example:
                              $.description: foo
                              $.questions.question_leak.default_answer: $LEAK_EQUIPMENT
                          type:
                            type: string
                            enum:
                            - delay
                          time_period:
                            type: string
                            enum:
                            - hours
                            - days
                            - weeks
                            - months
                          duration:
                            type: number
                            minimum: 0
                            exclusiveMinimum: true
                          from:
                            type: string
                            enum:
                            - now
                            - previous_workflow
                        required:
                        - type
                        - time_period
          

# --- truncated at 32 KB (178 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/validere/refs/heads/main/openapi/validere-workflow-templates-api-openapi.yml