Workflows Run named, policy-controlled workflow steps that can call GraphJin tools and GraphQL. agentic guide agentic/workflows agentic/workflows.md

Workflows

Run named, policy-controlled workflow steps that can call GraphJin tools and GraphQL.

Named workflows

Workflows let GraphJin expose reviewed operational procedures instead of letting agents improvise multi-step actions.

YAML
sources:
  - name: workflows
    kind: workflow
    path: ./workflows
    runtime: javascript
    capabilities:
      workflow.execute: true
      workflow.read: false
      workflow.write: false
Shell
graphjin workflow run nightly-report --vars report-vars.json

Workflows can call GraphJin tools and GraphQL when allowed by configuration. They respect declared variables, timeouts, context cancellation, and workflow execution policy.

Verified by TestRunNamedWorkflow_CanCallGJTools serv/workflows_test.go:109
Verified by TestRunNamedWorkflow_CanExecuteGraphQLWhenAllowed serv/workflows_test.go:142

GraphQL control-plane shape

GraphQL
mutation RunWorkflow($vars: JSON!) {
  gj_workflow_execution(insert: {
    name: "nightly-report"
    variables: $vars
  }) {
    id
    status
    output_json
    error
  }
}

Workflow rows also appear in gj_catalog, so a model can inspect names, variable contracts, lifecycle metadata, and safety notes before execution.

Verified by TestQueryCatalogReturnsWorkflowCards serv/mcp_catalog_workflow_test.go:15
Verified by TestGraphQLControlPlaneWorkflowLifecycle serv/control_plane_graphql_test.go:307

Safety

Use workflows for bounded operations that need a name, review trail, inputs, and clear failure behavior.

Workflows should declare variables and timeouts. The runtime respects context cancellation and blocks workflow-management tools unless the caller/config explicitly allows them.

Verified by TestHandleExecuteWorkflow_RequiresDeclaredVariables serv/workflows_test.go:216
Verified by TestRunNamedWorkflow_BlocksWorkflowMutationTools serv/workflows_test.go:383

Docs