Saltar al contenido principal
Reference

GraphQL API

The GraphQL API provides a flexible, typed interface for querying and mutating WorkFlows resources. Request exactly the fields you need with a single endpoint.

Coming Soon

The GraphQL API is currently in development and will be available in an upcoming release. The schema below represents the planned API design. In the meantime, use the REST API for full programmatic access to WorkFlows.

Endpoint

GraphQL Endpoint
POST https://www.workflows.com.es/api/graphql

Headers:
  Authorization: Bearer wf_live_your_key
  Content-Type: application/json

Example Query

GraphQL
query GetProjectAlerts($projectId: ID!) {
  project(id: $projectId) {
    id
    name
    area
  }
  alerts(filter: { projectId: $projectId, status: ACTIVE }) {
    id
    title
    severity
    createdAt
  }
}

# Variables
{
  "projectId": "proj_xxx"
}
Response
{
  "data": {
    "project": {
      "id": "proj_xxx",
      "name": "Supply Chain Q1",
      "area": "Logistics"
    },
    "alerts": [
      {
        "id": "alert_abc",
        "title": "Low inventory: Raw Material A",
        "severity": "CRITICAL",
        "createdAt": "2026-06-10T14:30:00Z"
      }
    ]
  }
}

Example Mutation

GraphQL
mutation AskQuestion {
  askAI(input: {
    message: "What were the top 5 suppliers by delivery delay in Q1?"
    projectId: "proj_xxx"
  }) {
    answer
    tokens
    model
  }
}

Schema Reference

Query

FieldTypeDescription
projects[Project!]!List all projects in the organization
project(id: ID!)ProjectGet a project by ID
alerts[Alert!]!List alerts with optional filters
alert(id: ID!)AlertGet an alert by ID
connections[Connection!]!List database connections
history[QueryRecord!]!List query history
users[User!]!List organization members
usageUsageStats!Get current usage statistics

Mutation

FieldTypeDescription
createProject(input: CreateProjectInput!)Project!Create a new project
updateProject(id: ID!, input: UpdateProjectInput!)Project!Update a project
deleteProject(id: ID!)Boolean!Delete a project
createAlert(input: CreateAlertInput!)Alert!Create a new alert
resolveAlert(id: ID!)Alert!Mark an alert as resolved
askAI(input: AskInput!)AIResponse!Send a natural language query
createWebhook(input: CreateWebhookInput!)Webhook!Register a webhook

Subscription

FieldTypeDescription
alertCreatedAlert!New alert created in the organization
alertResolvedAlert!An alert was resolved
queryCompleted(projectId: ID)QueryRecord!AI query completed

Core Types

Project

Schema
type Project {
  id: ID!
  name: String!
  area: String
  description: String
  createdAt: DateTime!
  updatedAt: DateTime!
}

Alert

Schema
type Alert {
  id: ID!
  title: String!
  severity: AlertSeverity!
  status: AlertStatus!
  projectId: ID!
  area: String
  value: String
  threshold: String
  createdAt: DateTime!
}

Connection

Schema
type Connection {
  id: ID!
  name: String!
  dbType: ConnectionType!
  status: ConnectionStatus!
}

AIResponse

Schema
type AIResponse {
  answer: String!
  tokens: Int!
  model: String!
  projectId: ID!
}