queries.mdx•8.92 kB
---
title: "Queries"
description: "Queries are used to retrieve configs, logs, and workflow info."
---
## List Operations
### listRuns
Returns a paginated list of execution runs.
**Parameters:**
- `limit`: Int - Number of items to return (default: 10, max: 100)
- `offset`: Int - Number of items to skip (default: 0)
- `configId`: ID - Filter runs by specific configuration ID (optional)
<Tabs>
<Tab title="GraphQL">
```graphql
query ListRuns($limit: Int = 10, $offset: Int = 0, $configId: ID) {
listRuns(limit: $limit, offset: $offset, configId: $configId) {
items {
id
success
error
startedAt
completedAt
data
config {
... on Workflow {
id
version
instruction
createdAt
updatedAt
}
}
}
total
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const { items, total } = await client.listRuns(100, 0);
```
</Tab>
</Tabs>
### listWorkflows
Returns a paginated list of workflow configurations.
<Tabs>
<Tab title="GraphQL">
```graphql
query ListWorkflows($limit: Int = 10, $offset: Int = 0) {
listWorkflows(limit: $limit, offset: $offset) {
items {
id
version
createdAt
updatedAt
instruction
steps {
id
apiConfig {
id
urlHost
urlPath
method
instruction
authentication
}
integrationId
executionMode
loopSelector
loopMaxIters
inputMapping
responseMapping
}
integrationIds
finalTransform
responseSchema
inputSchema
}
total
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const { items, total } = await client.listWorkflows(10, 0);
```
</Tab>
</Tabs>
### listIntegrations
Returns a paginated list of integration configurations.
<Tabs>
<Tab title="GraphQL">
```graphql
query ListIntegrations($limit: Int = 10, $offset: Int = 0) {
listIntegrations(limit: $limit, offset: $offset) {
items {
id
name
type
urlHost
urlPath
documentationUrl
documentation
documentationPending
specificInstructions
icon
version
createdAt
updatedAt
}
total
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const { items, total } = await client.listIntegrations(10, 0);
```
</Tab>
</Tabs>
### listWorkflowSchedules
Returns all schedules for a specific workflow.
**Parameters:**
- `workflowId`: String! - The workflow ID to list schedules for (required)
<Tabs>
<Tab title="GraphQL">
```graphql
query ListWorkflowSchedules($workflowId: String!) {
listWorkflowSchedules(workflowId: $workflowId) {
id
workflowId
cronExpression
timezone
enabled
payload
options
lastRunAt
nextRunAt
createdAt
updatedAt
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const schedules = await client.listWorkflowSchedules("workflow-id");
// Example response:
// [
// {
// id: "schedule-1",
// workflowId: "workflow-id",
// cronExpression: "0 2 * * *",
// timezone: "America/New_York",
// enabled: true,
// payload: { customParam: "value" },
// options: { timeout: 30000 },
// lastRunAt: "2025-10-23T06:00:00Z",
// nextRunAt: "2025-10-24T06:00:00Z",
// createdAt: "2025-10-01T10:00:00Z",
// updatedAt: "2025-10-23T06:00:00Z"
// }
// ]
```
</Tab>
</Tabs>
## Get Operations
### getRun
Retrieves a specific execution run by ID.
<Tabs>
<Tab title="GraphQL">
```graphql
query GetRun($id: ID!) {
getRun(id: $id) {
id
success
error
startedAt
completedAt
data
config {
... on Workflow {
id
version
instruction
createdAt
updatedAt
}
}
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const run = await client.getRun("run-id");
```
</Tab>
</Tabs>
### getWorkflow
Retrieves a specific workflow configuration by ID.
<Tabs>
<Tab title="GraphQL">
```graphql
query GetWorkflow($id: ID!) {
getWorkflow(id: $id) {
id
version
createdAt
updatedAt
instruction
steps {
id
apiConfig {
id
urlHost
urlPath
method
instruction
authentication
}
integrationId
executionMode
loopSelector
loopMaxIters
inputMapping
responseMapping
}
integrationIds
finalTransform
responseSchema
inputSchema
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const workflow = await client.getWorkflow("workflow-id");
```
</Tab>
</Tabs>
### getIntegration
Retrieves a specific integration configuration by ID.
<Tabs>
<Tab title="GraphQL">
```graphql
query GetIntegration($id: ID!) {
getIntegration(id: $id) {
id
name
type
urlHost
urlPath
credentials
documentationUrl
documentation
documentationPending
specificInstructions
icon
version
createdAt
updatedAt
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const integration = await client.getIntegration("integration-id");
```
</Tab>
</Tabs>
## Utility Queries
### generateSchema
Generates a JSON schema based on instructions and optional response data. Useful for creating response schemas for workflows.
**Parameters:**
- `instruction`: String! - Natural language description of the desired schema (required)
- `responseData`: String - Sample JSON data to infer schema from (optional)
<Tabs>
<Tab title="GraphQL">
```graphql
query GenerateSchema($instruction: String!, $responseData: String) {
generateSchema(instruction: $instruction, responseData: $responseData)
}
```
</Tab>
<Tab title="SDK">
```typescript
const schema = await client.generateSchema(
"Get me all characters with only their name",
'[{"name": "Rick", "species": "Human"}, {"name": "Morty", "species": "Human"}]'
);
```
</Tab>
</Tabs>
### generateInstructions
Generates natural language instructions based on integration configurations. Helps create workflow instructions from available integrations.
**Parameters:**
- `integrations`: [IntegrationInput!]! - List of integrations to generate instructions for (required)
<Tabs>
<Tab title="GraphQL">
```graphql
query GenerateInstructions($integrations: [IntegrationInput!]!) {
generateInstructions(integrations: $integrations)
}
```
</Tab>
<Tab title="SDK">
```typescript
const instructions = await client.generateInstructions([
{
id: "integration-1",
name: "GitHub API",
urlHost: "https://api.github.com",
documentationUrl: "https://docs.github.com/en/rest"
}
]);
```
</Tab>
</Tabs>
### getTenantInfo
Retrieves tenant account information.
<Tabs>
<Tab title="GraphQL">
```graphql
query GetTenantInfo {
getTenantInfo {
email
emailEntrySkipped
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const tenantInfo = await client.getTenantInfo();
```
</Tab>
</Tabs>
### findRelevantIntegrations
Finds integrations relevant to a given natural language instruction. Returns suggested integrations with explanations.
**Parameters:**
- `instruction`: String - Natural language description of what you want to do (optional, returns all integrations if not provided)
<Tabs>
<Tab title="GraphQL">
```graphql
query FindRelevantIntegrations($instruction: String) {
findRelevantIntegrations(instruction: $instruction) {
id
reason
savedCredentials
}
}
```
</Tab>
<Tab title="SDK">
```typescript
const suggestions = await client.findRelevantIntegrations(
"I need to send emails and track analytics"
);
// Returns integrations like SendGrid, PostHog, etc. with reasons
```
</Tab>
</Tabs>
#### Fields
- `instruction`: String (optional) - Natural language description of what you want to do
- Returns: Array of `SuggestedIntegration` objects