Skip to content
Discussion options

You must be logged in to vote

https://laravel-workflow.com/docs/features/queries

Queries are meant for this. They enable you to pull information out of the workflow.

use Workflow\QueryMethod;
use Workflow\Workflow;

class MyWorkflow extends Workflow
{
    private int $step = 1;

    #[QueryMethod]
    public function getCurrentStep(): int
    {
        return $this->step;
    }
}

Then outside of your workflow you can get the current step like this.

use Workflow\WorkflowStub;

$workflow = WorkflowStub::load($workflowId);

$step = $workflow->getCurrentStep();

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tonypartridge
Comment options

@ahmedsadeki
Comment options

Answer selected by rmcdaniel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants