ProCanvasField

Alpha API: ProCanvasField and its JavaScript bridge may change before a stable Pro release. Treat form integration as preview-only.

ProCanvasField is the Filament form field shipped by dbflowlabs/filament-pro. It renders the LogicFlow workflow canvas inside Filament forms and reads/writes graph JSON that the Pro compiler turns into Core-compatible definitions.

Responsibilities

Concern Handled by
Canvas rendering ProCanvasField + LogicFlow
Graph state JSON stored on the form field (graph document)
Compilation ProGraphBlueprintCompiler + WorkflowGraphJsonParser (outside the field)
Runtime execution dbflowlabs/core — unchanged

The field designs topology. It does not start workflows, create tasks, or approve assignments.

Assets

Pro canvas UI depends on published Filament assets:

  • ProCanvasJs
  • ProCanvasCss

After installing dbflowlabs/filament-pro, publish config and register assets:

php artisan vendor:publish --tag=dbflow-filament-pro-config
php artisan filament:assets

If the canvas appears unstyled or non-interactive, re-run php artisan filament:assets and clear your browser cache. Asset paths are managed by DBFlowFilamentProServiceProvider.

Where it appears

In typical integrations, ProCanvasField is used by ProCanvasWorkflowDefinitionEditorResolver inside Standard WorkflowResource — not as a standalone public route in every host app.

For isolated testing, dbflow-demo exposes ProCanvasSandboxPage at:

/admin/pro-canvas-sandbox

The sandbox can load refund (refund_dispute_approval) and procurement (procurement_request_approval) fixtures for visual inspection.

Conceptual form usage

A stable, copy-paste form schema is not guaranteed across alpha tags. The pattern is:

  1. Standard WorkflowResource (or a custom Filament page) resolves the definition editor through workflow_definition_editor_resolver.
  2. When Pro is installed, ProCanvasWorkflowDefinitionEditorResolver supplies a form schema that includes ProCanvasField.
  3. The field binds to graph JSON on the draft definition record.
  4. On save/publish, graph JSON is compiled and validated before persisting to dbflow_workflow_versions.

Do not hand-wire ProCanvasField in production admin panels without following the resolver integration in Standard Integration.

Graph JSON vs runtime JSON

Artifact Purpose
Graph JSON Canvas nodes, edges, and editor metadata (ProCanvasField state)
Core definition array nodes + transitions consumed by DBFlow::start() (schema_version: 1.0)

Condition routing authority remains transitions[].condition after compilation — not ad-hoc canvas metadata. See Conditions.

Developer checklist

  • Run WorkflowDefinitionValidator::validateOrFail() on compiled output
  • Add PHPUnit coverage for critical branches (Testing Workflows)
  • Restrict who can open definition editors (Permissions)
  • Read Preview Limitations before granting production publish rights

What's next

Something wrong? Open an issue on GitHub