Skip to main content

CLI reference

Seven Artisan commands, registered automatically.


workflow:build​

php artisan workflow:build {id?}

Interactively build or edit a workflow definition step by step. With no id, you choose to start a new workflow or pick an existing one to edit. With an id that exists, you edit its draft; with one that doesn't, you name and create it.

Walks you through the trigger, then a menu loop for adding / reconfiguring / removing / reconnecting nodes, then validation and save. Saving writes the draft only — publish it with workflow:publish. Only nodes and triggers that report cliSupported() are offered. See Building workflows.


workflow:run​

php artisan workflow:run {id} {--payload=} {--draft}

Run a workflow synchronously and print its execution timeline.

Argument / optionNotes
idRequired. The workflow id. Unknown ids list what's available.
--payload=JSON object used as the trigger payload.
--draftRun the unpublished draft instead of the published version.

Without --draft, a workflow that has never been published fails with a message telling you to publish it or pass --draft.

When --payload is omitted and the trigger accepts input, the command prompts for each field, seeded from the trigger's saved config. In a non-interactive context it runs with whatever --payload provided (or an empty payload).

Exit code is 0 only if the execution succeeded.


workflow:publish​

php artisan workflow:publish {id} {--note=}

Publish a workflow's draft as its next version. See Publishing & versions.

Argument / optionNotes
idRequired. The workflow id.
--note=A note describing this version.

If the draft has no unpublished changes, nothing is created and the command reports the version that is already published.


workflow:rollback​

php artisan workflow:rollback {id} {version} {--note=}

Republish an earlier version as the next version. The draft is left untouched. See Rolling back.

Argument / optionNotes
idRequired. The workflow id.
versionRequired. The earlier version number to republish. Fails if it doesn't exist.
--note=A note describing this rollback. Defaults to Rollback to v{version}.

If that version's content is already published, nothing is created.


workflow:export​

php artisan workflow:export {id?} {--all} {--latest=} {--draft} {--path=}

Write workflows to JSON files, with sensitive values redacted. See Exporting and importing.

Argument / optionNotes
idExport only this workflow. Omit to export every workflow.
--allExport every version instead of only the published one.
--latest=Export only the newest N versions (a whole number of at least 1). Can't be combined with --all.
--draftAlso export the draft, as the version after the latest one.
--path=Directory to export into. Defaults to resources/workflows.

Workflows that have never been published are skipped unless --draft is given.


workflow:import​

php artisan workflow:import {id?} {--path=} {--force}

Import workflows from files written by workflow:export. Existing versions are never overwritten, and sensitive values already stored are kept. See What import does.

Argument / optionNotes
idImport only this workflow. Omit to import every exported workflow in the directory.
--path=Directory to import from. Defaults to resources/workflows.
--forceReplace drafts that have unpublished changes.

Prints what was created, updated, and published for each workflow, plus any warnings. Exits non-zero when a single id was requested and could not be imported.


workflow:make-node​

php artisan workflow:make-node {name} {--type=} {--trigger} {--force}

Generate a new node (or trigger) class from a stub.

Argument / optionNotes
nameClass name, e.g. SendSlackMessageNode. Prompted if omitted.
--type=The type identifier, e.g. app::send-slack-message. Defaults to app:: + kebab-cased class name.
--triggerGenerate a Trigger subclass instead of a Node.
--forceOverwrite an existing class.

Nodes are written to app/Workflows/Nodes, triggers to app/Workflows/Triggers. You still need to register the class — see Custom nodes.