# Get list of workflows

- Operation ID: `getPaginatedDiagramsV2`
- HTTP method: `GET`
- Path: `/automation-brain/v2/diagrams`
- [Human-readable API reference](https://hub.synerise.com/api-reference/automation#tag/Workflows/operation/getPaginatedDiagramsV2)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /automation-brain/v2/diagrams:
    get:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Get list of workflows
      operationId: getPaginatedDiagramsV2
      description: |
        Retrieve a paginated list of workflows.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `AUTOMATON_BRAIN_DIAGRAM_LIST_READ`

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - name: page
          in: query
          description: The selected page
          schema:
            type: number
            default: 1
            minimum: 1
        - name: limit
          in: query
          description: Number of items per page
          schema:
            type: number
            default: 50
        - name: status
          in: query
          description: Filter workflows by status
          schema:
            type: string
            enum:
              - All
              - Recent
              - Draft
              - Pending
              - Active
              - Paused
              - Stopped
              - Inactive
              - Scheduled
              - NoSchedule
              - ScheduleOn
              - ScheduleOff
            default: All
        - name: sort
          in: query
          description: Sort workflows by a property value
          schema:
            type: string
            enum:
              - Author
              - Name
              - CreatedTime
              - UpdatedTime
              - Status
            default: UpdatedTime
        - name: sortBy
          in: query
          description: Sort workflows clause
          example: createdTime:desc
          schema:
            type: string
        - name: order
          in: query
          description: Sorting order
          schema:
            type: string
            enum:
              - Asc
              - Desc
            default: Desc
        - name: search
          in: query
          description: A string to search for in workflow names and email addresses of authors. Workflows that don't match the search aren't returned at all.
          schema:
            type: string
        - name: directoryId
          in: query
          description: UUID of the directory/catalogue/folder.
          schema:
            type: string
            format: uuid
        - name: tags
          in: query
          required: false
          schema:
            type: string
            description: List of comma separated tags
        - name: blockTypes
          in: query
          required: false
          description: |
            Comma-separated list of block type names (e.g. "Email,EventTrigger").
            If provided, only workflows that contain a block of EVERY listed type
            are returned. The parameter may also be repeated.
          schema:
            type: string
        - name: triggersOnEvent
          in: query
          required: false
          description: |
            Event name that triggers or filters the workflow. If provided, only
            workflows containing an EventTrigger or EventFilter block configured
            for this event are returned. Matched case-insensitively.
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-zA-Z0-9.\-_]+$
        - name: generatesEvent
          in: query
          required: false
          description: |
            Event name generated by the workflow. If provided, only workflows
            containing a SendEvent block, or a Webhook block whose responseAction
            is set to this event, are returned. Matched case-insensitively.
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-zA-Z0-9.\-_]+$
      responses:
        "200":
          description: A page of workflows
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    description: An array of workflows
                    items:
                      type: object
                      description: Details of the workflow
                      required:
                        - diagramId
                        - author
                        - listingAuthor
                        - name
                        - created
                        - updated
                        - status
                        - scheduleStatus
                        - configuration
                        - catalogId
                        - context
                        - tags
                        - description
                        - hasTransformation
                        - businessProfileId
                      properties:
                        diagramId:
                          type: string
                          format: uuid
                          description: UUID of the workflow
                        author:
                          description: Author of the workflow
                          type: string
                          example: example@synerise.com
                        listingAuthor:
                          type: object
                          properties:
                            userId:
                              type: number
                            clientId:
                              type: number
                            clientApiHash:
                              type: string
                            businessProfileApiHash:
                              type: string
                        name:
                          type: string
                          description: Name of the workflow
                          example: Example workflow
                        created:
                          description: Creation time
                          type: string
                          format: date-time
                          example: 2019-01-04T13:17:18.315Z
                        updated:
                          description: Last update time
                          type: string
                          format: date-time
                          example: 2019-01-04T13:17:18.315Z
                        status:
                          type: string
                          description: The status of the workflow
                          enum:
                            - Draft
                            - Pending
                            - Running
                            - Paused
                            - Stopped
                        scheduleStatus:
                          description: Workflow schedule status
                          type: string
                          enum:
                            - On
                            - Off
                            - NoSchedule
                        configuration:
                          description: Workflow configuration
                          type: object
                          properties:
                            capping:
                              type: object
                              description: Capping configuration of the workflow
                              required:
                                - limit
                                - period
                              properties:
                                limit:
                                  type: number
                                  description: The maximum number of times the a journey for a single profile within the limits defined in `period`
                                period:
                                  type: object
                                  description: The time period for the quantitative limit defined in `limit`
                                  required:
                                    - type
                                  properties:
                                    type:
                                      type: string
                                      description: |-
                                        The type of time limit. `Time` is the only type available for workflows. A journey can be started X times in a period defined by `timeSeconds`.
                                        X is defined by the `limit` field.
                                      enum:
                                        - Time
                                    timeSeconds:
                                      type: number
                                      description: The length of the limit, in seconds (the limit is always calculated into seconds, even if another unit of time is used in the Synerise Web Application).
                            multipleJourneys:
                              type: boolean
                              description: Diagram has multiple journeys enabled
                              default: false
                        catalogId:
                          description: UUID of the catalog where the workflow is saved
                          type: string
                          example: 030a9be3-8ccc-44c7-b20b-27768816cab7
                        context:
                          description: |
                            Context of the workflow.
                            - `Client` workflows are triggered by "Profile Event"; "Data Changed"; and "Audience" nodes.
                            - `Business` workflows are triggered by "Business Event" and "Scheduled Run" nodes.
                            - `Undefined` workflows have no trigger and can't be started until their configuration is finished.
                          type: string
                          enum:
                            - Client
                            - Business
                            - Undefined
                        tags:
                          description: Tags associated with this workflow
                          type: array
                          items:
                            type: object
                            required:
                              - hash
                              - value
                              - color
                            properties:
                              hash:
                                type: string
                                example: 030a9be3-8ccc-44c7-b20b-27768816cab7
                                description: Unique ID of the tag
                              value:
                                type: string
                                description: Name of the tag
                              color:
                                type: string
                                description: Color of the tag, hexadecimal
                                example: "#0b68ff"
                              description:
                                type: string
                                description: Description of the tag
                              icon:
                                type: string
                                description: URL of the tag's icon
                        description:
                          description: Workflow description
                          type: string
                          example: Sample workflow description
                        hasTransformation:
                          type: boolean
                          description: "`true` if the workflow contains Data Transformation nodes"
                        businessProfileId:
                          type: number
                  meta:
                    type: object
                    description: Pagination data
                    required:
                      - limit
                      - links
                    properties:
                      limit:
                        type: number
                        example: 3
                        description: Maximum number of items per page
                      links:
                        type: array
                        description: Links to previous/next/first pages
                        items:
                          type: object
                          required:
                            - rel
                            - url
                          properties:
                            rel:
                              type: string
                              description: The type of relation
                              example: first
                              enum:
                                - first
                                - prev
                                - next
                            url:
                              type: string
                              description: Link to the page
                              example: http://automation-brain/v2/diagrams?page=1&limit=10
        "400":
          description: "Bad request: input data missing or malformed"
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  message:
                    type: string
                    description: Description of the problem
        "401":
          description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc."
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  message:
                    type: string
                    description: Description of the problem
        "403":
          description: Forbidden; insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  message:
                    type: string
                    description: Description of the problem
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  message:
                    type: string
                    description: Description of the problem
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/getPaginatedDiagramsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE&blockTypes=SOME_STRING_VALUE&triggersOnEvent=SOME_STRING_VALUE&generatesEvent=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE&blockTypes=SOME_STRING_VALUE&triggersOnEvent=SOME_STRING_VALUE&generatesEvent=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE&blockTypes=SOME_STRING_VALUE&triggersOnEvent=SOME_STRING_VALUE&generatesEvent=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE&blockTypes=SOME_STRING_VALUE&triggersOnEvent=SOME_STRING_VALUE&generatesEvent=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/automation-brain/v2/diagrams');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_NUMBER_VALUE',
              'limit' => 'SOME_NUMBER_VALUE',
              'status' => 'SOME_STRING_VALUE',
              'sort' => 'SOME_STRING_VALUE',
              'sortBy' => 'createdTime:desc',
              'order' => 'SOME_STRING_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'directoryId' => 'SOME_STRING_VALUE',
              'tags' => 'SOME_STRING_VALUE',
              'blockTypes' => 'SOME_STRING_VALUE',
              'triggersOnEvent' => 'SOME_STRING_VALUE',
              'generatesEvent' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE&blockTypes=SOME_STRING_VALUE&triggersOnEvent=SOME_STRING_VALUE&generatesEvent=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Workflows
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
