Query Workflows

Workflow: Query Workflows

User Intent

"I want to list all my workflows or find a specific workflow by name"

Operation

  • SDK Method: graphlit.queryWorkflows() or graphlit.getWorkflow()

  • GraphQL: queryWorkflows or getWorkflow query

  • Entity Type: Workflow

  • Common Use Cases: List workflows, find workflow by name, check workflow configuration

TypeScript (Canonical)

import { Graphlit } from 'graphlit-client';
import { EntityState } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

// Query all workflows
const workflows = await graphlit.queryWorkflows();

console.log(`Total workflows: ${workflows.workflows.results.length}`);

workflows.workflows.results.forEach(workflow => {
  console.log(`- ${workflow.name} (${workflow.state})`);
});

// Search by name
const searchResults = await graphlit.queryWorkflows({
  search: 'Extraction'
});

console.log(`\nFound ${searchResults.workflows.results.length} extraction workflows`);

// Get specific workflow
// Replace with ID from creating a workflow or from queryWorkflows results above
const workflowId = 'workflow-id-here';
const workflow = await graphlit.getWorkflow(workflowId);

console.log(`\nWorkflow: ${workflow.workflow.name}`);
console.log(`Created: ${workflow.workflow.creationDate}`);

// Check workflow type
if (workflow.workflow.extraction) {
  console.log('Type: Extraction workflow');
  console.log(`Jobs: ${workflow.workflow.extraction.jobs?.length || 0}`);
} else if (workflow.workflow.preparation) {
  console.log('Type: Preparation workflow');
  console.log(`Jobs: ${workflow.workflow.preparation.jobs?.length || 0}`);
}

Query all workflows (snake_case)

workflows = await graphlit.queryWorkflows()

print(f"Total workflows: {len(workflows.workflows.results)}")

for workflow in workflows.workflows.results: print(f"- {workflow.name} ({workflow.state})")

Search by name

search_results = await graphlit.queryWorkflows( filter=WorkflowFilterInput( search="Extraction" ) )

Get specific workflow

workflow = await graphlit.getWorkflow(workflow_id) print(f"Workflow: {workflow.workflow.name}")

Parameters

queryWorkflows (Optional Filter)

  • search (string): Search by workflow name

  • states (EntityState[]): Filter by state

    • ENABLED, DISABLED

getWorkflow (Required)

  • id (string): Workflow ID

Response

Developer Hints

Workflow Types

Three main workflow types:

Find Workflow by Name

Workflow Inventory

Variations

1. List All Workflows

Get all workflows:

2. Search by Name

Find specific workflows:

3. Get Workflow Details

Retrieve full configuration:

4. Filter Active Workflows

Only enabled workflows:

5. Workflow Summary Report

Generate workflow summary:

Common Issues

Issue: Workflow not found error Solution: Verify workflow ID is correct. Workflow may have been deleted.

Issue: Search returns no results Solution: Search is case-sensitive. Try partial matches.

Issue: Can't determine workflow type Solution: Check preparation and extraction properties. One or both will be present.

Production Example

Workflow management dashboard:

Last updated

Was this helpful?