Workflows

Create, manage and query Workflows.

Overview

As files, Web pages or RSS posts are ingested into Graphlit, they proceed through several stages of a content workflow.

  • Ingestion: Identifying the source content from its original location, and caching it on cloud storage for later processing.

  • Indexing: Parsing the source content, and creating technical metadata which describes the content type, file type, file size, and specific properties such as document title, audio duration or image resolution. For some content types, this also includes creating a list of hyperlinks referenced by the source content.

  • Preparation: Preparing the cached content for processing by ML models or APIs, by extracting text from documents or Web pages, transcribing audio from media files, or resizing images.

  • Extraction: From the extracted document text or audio transcript, identifying named entities such as people, places or organizations, and connecting them with their source content in the Graphlit knowledge graph.

  • Enrichment: For extracted entities, enriching their metadata via 3rd party APIs to provide more precise entity resolution and deduplication. For content, optionally ingesting linked content via link crawling.

  • Actions: As content proceeds through the workflow, developers can listen on finished and errored events for integrating the Graphlit event-driven workflow with their applications.

Graphlit follows a pattern of requiring opt-in to functionality which adds additional credit usage. In order to prevent unexpected costs, any LLM or API-based processing must be configured via workflow, and is not enabled by default.

For example, LLM-based content summarization or entity extraction.

The exceptions to this rule are Deepgram audio transcription and Azure AI document preparation, which is enabled by default, and will incur Graphlit credit usage.

When creating workflows, you can assign properties to one or more of the workflow stages. None of the stages are required, and various stages can be combined together into a single workflow.

Once created, workflows can specified with the createFeed mutation, or provided with the ingestUri or ingestText mutations, to control how content is ingested and processed into the Graphlit Platform.

Also, you can specify the default workflow for a project, which applies to all content, unless otherwise specified by the mutations above.

Create Workflow

The createWorkflow mutation enables the creation of a workflow by accepting the workflow name and it returns essential details, including the ID, name and state of the newly generated workflow.

Mutation:

mutation CreateWorkflow($workflow: WorkflowInput!) {
  createWorkflow(workflow: $workflow) {
    id
    name
    state
  }
}

Variables:

{
  "workflow": {
    "name": "Workflow"
  }
}

Response:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
  "name": "Workflow",
  "state": "ENABLED"
}
Update Workflow

The updateWorkflow mutation enables the update of a workflow by accepting the workflow id and optional parameters such as name. It returns essential details, including the ID, name and state of the newly generated workflow.

Mutation:

mutation UpdateWorkflow($workflow: WorkflowUpdateInput!) {
  updateWorkflow(workflow: $workflow) {
    id
    name
    state
  }
}

Variables:

{
  "workflow": {
    "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
    "name": "New Workflow"
  }
}

Response:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
  "name": "New Workflow",
  "state": "ENABLED"
}
Delete Workflow

If you no longer need a workflow, you can use the deleteWorkflow mutation, and pass the ID of the workflow you wish to delete.

NOTE: Workflows that are currently in use by a feed, or assigned as the default workflow on a project, cannot be deleted.

Mutation:

mutation DeleteWorkflow($id: ID!) {
  deleteWorkflow(id: $id) {
    id
    state
  }
}

Variables:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a"
}

Response:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
  "state": "DELETED"
}
Get Workflow

The workflow query allows you to retrieve specific details of a workflow by providing the id parameter, including the ID, name, state, owner ID, and type associated with the workflow.

Query:

query GetWorkflow($id: ID!) {
  workflow(id: $id) {
    id
    name
    creationDate
    owner {
      id
    }
    state
  }
}

Variables:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a"
}

Response:

{
  "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
  "name": "Workflow",
  "state": "ENABLED",
  "creationDate": "2023-09-05T23:06:15Z",
  "owner": {
    "id": "530a3721-3273-44b4-bff4-e87218143164"
  }
}
Query Workflows

The workflows query allows you to retrieve all workflows. It returns a list of workflow results, including the ID, name, creation date, state, owner ID, and type for each workflow.

Query:

query QueryWorkflows($filter: WorkflowFilter!) {
  workflows(filter: $filter) {
    results {
      id
      name
      creationDate
      owner {
        id
      }
      state
    }
  }
}

Variables:

{
  "filter": {
    "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
    "offset": 0,
    "limit": 100
  }
}

Response:

{
  "results": [
    {
      "id": "8f5e0cff-98dc-44ef-8736-e18670894f6a",
      "name": "Workflow",
      "state": "ENABLED",
      "creationDate": "2023-09-05T23:06:15Z",
      "owner": {
        "id": "530a3721-3273-44b4-bff4-e87218143164"
      }
    }
  ]
}

Workflow Stage Configuration

Last updated