AI Agents Usage.

Get information about the usage of AI Agents on an organization.

Use Case Template

Title: AI Agents Usage Details

Before You Begin

  • GraphQL Playground:
    🔗 All examples should be run in the GraphQL Playground.
    ➡️ New to GraphQL? Review the Playground Basics Guide.
  • Authentication:
    🛠️ Use Service Account tokens (Personal Access Tokens are deprecated).

Prerequisites

  • Super Admin role on the Organization.
  • Organization UUID.

Step 1. Find the Organization UUID

Find the organization UUID.

You can retrieve it using this query:

{
  organization(id: "<ORGANIZATION_ID>") {
    uuid
  }
}

The organization ID can be found on the home page url: https://app.pipefy.com/organizations/<ORGANIZATION_ID>

Step 2. Execute the query

  query agentsUsageDetails(
    $organizationUuid: ID!
    $filterDate: DateRange!
    $search: String
    $first: Int
    $after: String
    $filters: FilterParams
    $sort: SortCriteria
  ) {
    agentsUsageDetails(
      organizationUuid: $organizationUuid
      filterDate: $filterDate
      search: $search
      filters: $filters
      sort: $sort
    ) {
      availableFilters {
        action
        event
        pipes {
          name
          uuid
          __typename
        }
        status
        __typename
      }
      usage
      agents(after: $after, first: $first) {
        totalCount
        edges {
          node {
            id
            name
            usage
            action
            event
            name
            status
            actionRepo {
              color
              icon
              name
              uuid
              __typename
            }
            eventRepo {
              color
              icon
              name
              uuid
              __typename
            }
            createdAt
            createdBy {
              avatarUrl
              name
              __typename
            }
            updatedAt
            tags {
              name
              __typename
            }
            __typename
          }
          __typename
        }
        pageInfo {
          hasNextPage
          hasPreviousPage
          startCursor
          endCursor
          __typename
        }
        __typename
      }
      __typename
    }
  }

Input Explanation:

  • filterDate: The dates you want to query for. You can only query for dates within the last 3 months. Example:
filterDate: {
    from: "2025-04-01T00:00:00Z",
    to: "2025-04-29T16:01:36Z"
  }
  • search: Search by automation name
  • filter: Filter by action pipe, event pipe, status or tags.
  • sort: Field and direction to sort the results.

Sample Response:

{
  "data": {
    "agentsUsageDetails": {
      "availableFilters": {
        "action": [
          "generate_with_ai"
        ],
        "event": [
          "card_created"
        ],
        "pipes": [
          {
            "name": "Pipe",
            "uuid": "uuid",
            "__typename": "AvailableFiltersPipeFilter"
          }
        ],
        "status": [
          "active"
        ],
        "__typename": "AvailableFilters"
      },
      "usage": 1,
      "agents": {
        "totalCount": 1,
        "edges": [
          {
            "node": {
              "id": "5",
              "name": "agent",
              "usage": 1,
              "action": "generate_with_ai",
              "event": "card_created",
              "status": "active",
              "actionRepo": {
                "color": "pink",
                "icon": "pipefy",
                "name": "pipe",
                "uuid": "uuid",
                "__typename": "RepoProperties"
              },
              "eventRepo": {
                "color": "pink",
                "icon": "pipefy",
                "name": "pipe",
                "uuid": "uuid",
                "__typename": "RepoProperties"
              },
              "createdAt": "2025-04-28T16:37:49Z",
              "createdBy": {
                "avatarUrl": "url",
                "name": "Name",
                "__typename": "User"
              },
              "updatedAt": "2025-04-28T16:37:49Z",
              "tags": ["uuid"],
              "__typename": "StatsDetails"
            },
            "__typename": "StatsDetailsEdge"
          }
        ],
        "pageInfo": {
          "hasNextPage": false,
          "hasPreviousPage": false,
          "startCursor": "MQ",
          "endCursor": "MQ",
          "__typename": "PageInfo"
        },
        "__typename": "StatsDetailsConnection"
      },
      "__typename": "AgentsDetails"
    }
  }
}

The response includes the total agents usage for that period, the list of agents with their usage and the available filters to be used to query.


Key Notes

This data is updated once a day, so results will not consider changes occurred in the current day.