Skip to main content

Queries

Queries allow you to retrieve information about the current state of a workflow without affecting its execution. This is useful for monitoring and debugging purposes.

To define a query method on a workflow, use the QueryMethod annotation:

use Workflow\QueryMethod;
use Workflow\Workflow;

class MyWorkflow extends Workflow
{
private bool $ready = false;

#[QueryMethod]
public function getReady(): bool
{
return $this->ready;
}
}

To query a workflow, call the method on the workflow instance. The query method will return the data from the workflow.

use Workflow\WorkflowStub;

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

$ready = $workflow->getReady();

Note: Querying a workflow does not advance its execution, unlike signals.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy