Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
import { WorkflowRegistry } from '@frontmcp/sdk';
// Access via scope
const workflows = scope.workflows;
// List all workflows
const allWorkflows = workflows.getWorkflows();
// Find a specific workflow
const wf = workflows.findByName('data-pipeline');
Methods
getWorkflows()
Get all workflows (local + dynamic).
getWorkflows(includeHidden?: boolean): WorkflowEntry[]
| Parameter | Type | Default | Description |
|---|
includeHidden | boolean | false | Include hidden workflows in results |
Example:
// Get all visible workflows
const workflows = registry.getWorkflows();
// Include hidden workflows
const allWorkflows = registry.getWorkflows(true);
findByName()
Find a workflow by its base name.
findByName(name: string): WorkflowEntry | undefined
Example:
const wf = registry.findByName('data-pipeline');
if (wf) {
console.log(`Found: ${wf.name}, steps: ${wf.getSteps().length}`);
}
findById()
Find a workflow by its ID.
findById(id: string): WorkflowEntry | undefined
search()
Search workflows by query, tags, or labels.
search(
query?: string,
opts?: { tags?: string[]; labels?: Record<string, string> }
): WorkflowEntry[]
Example:
// Search by name/description
const results = registry.search('pipeline');
// Filter by tags
const tagged = registry.search(undefined, { tags: ['etl'] });
registerDynamic()
Register a dynamic workflow at runtime.
registerDynamic(record: WorkflowDynamicRecord): void
removeDynamic()
Remove a dynamic workflow.
removeDynamic(workflowId: string): boolean
Returns: true if the workflow was found and removed, false otherwise.
subscribe()
Subscribe to workflow change events.
subscribe(
opts: { immediate?: boolean },
cb: (event: WorkflowChangeEvent) => void
): () => void
Returns: Unsubscribe function.
Example:
const unsubscribe = registry.subscribe(
{ immediate: true },
(event) => {
console.log(`Workflow ${event.kind}:`, event.version);
}
);
// Later: stop listening
unsubscribe();
hasAny()
Check if any workflows exist in the registry.
When the jobs & workflows system is enabled, workflow capabilities are exposed through these MCP tools:
| Tool | Description |
|---|
list-workflows | List all registered workflows with optional filtering |
execute-workflow | Execute a workflow by name (inline or background) |
get-workflow-status | Get execution status with per-step results |
register-workflow | Register a dynamic workflow at runtime |
remove-workflow | Remove a dynamic workflow |
Change Events
The registry emits events when workflows are added, updated, or removed:
interface WorkflowChangeEvent {
kind: 'added' | 'updated' | 'removed' | 'reset';
changeScope: 'global' | 'session';
version: number;
snapshot: readonly WorkflowEntry[];
sessionId?: string;
}
Lifecycle
buildMap() → Extract tokens, definitions from metadata
buildGraph() → Validate dependencies, populate graph
initialize() → Create instances, register dynamic workflows