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.
sources:
- name: workflows
kind: workflow
path: ./workflows
runtime: javascript
capabilities:
workflow.execute: true
workflow.read: false
workflow.write: falsegraphjin workflow run nightly-report --vars report-vars.jsonWorkflows can call GraphJin tools and GraphQL when allowed by configuration. They respect declared variables, timeouts, context cancellation, and workflow execution policy.
TestRunNamedWorkflow_CanCallGJTools
serv/workflows_test.go:109TestRunNamedWorkflow_CanExecuteGraphQLWhenAllowed
serv/workflows_test.go:142GraphQL control-plane shape
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.
TestQueryCatalogReturnsWorkflowCards
serv/mcp_catalog_workflow_test.go:15TestGraphQLControlPlaneWorkflowLifecycle
serv/control_plane_graphql_test.go:307Safety
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.
TestHandleExecuteWorkflow_RequiresDeclaredVariables
serv/workflows_test.go:216TestRunNamedWorkflow_BlocksWorkflowMutationTools
serv/workflows_test.go:383