Skip to main content
The RunInterface defines the contract for run objects that track workflow execution and job responses. It extends StringMappedInterface<TypedInterface> to provide string-keyed access to typed job responses.

Namespace

Chevere\Workflow\Interfaces\RunInterface

Methods

keys()

Provides access to the names of jobs with responses.
public function keys(): array
return
array<string>
Array of job names that have responses

uuid()

Provides access to workflow UUID V4 (RFC 4122).
public function uuid(): string
return
string
UUID V4 string identifying this workflow run. See RFC 4122

workflow()

Provides access to the workflow instance.
public function workflow(): WorkflowInterface
return
WorkflowInterface
The workflow being executed

container()

Provides access to the container instance.
public function container(): ContainerInterface
return
ContainerInterface
The PSR-11 container instance used for dependency injection

arguments()

Provides access to the arguments instance.
public function arguments(): ArgumentsInterface
return
ArgumentsInterface
The arguments passed to the workflow

skip()

Provides access to the skipped job names.
public function skip(): VectorInterface
return
VectorInterface<string>
Vector of job names that have been skipped

withResponse()

Returns an instance with the specified job response.
public function withResponse(string $job, mixed $response): self
This method MUST retain the state of the current instance and return an instance that contains the specified job response.
job
string
required
The job name
response
mixed
required
The response value from the job
return
self
New instance with the job response added

withSkip()

Returns an instance with the specified job names skipped.
public function withSkip(string ...$job): self
This method MUST retain the state of the current instance and return an instance that contains the specified job names skipped.
job
string
required
One or more job names to skip
return
self
New instance with the specified jobs skipped

response()

Provides access to the TypedInterface instance for the given job.
public function response(string $job, string|int ...$key): TypedInterface
job
string
required
The job name
key
string|int
Optional key(s) to access nested response values
return
TypedInterface
The typed response for the specified job (and optional key)

getReturn()

Deprecated. Use response() instead.
Provides access to the TypedInterface instance for the given job.
public function getReturn(string $job): TypedInterface
job
string
required
The job name
return
TypedInterface
The typed response for the specified job

toArray()

Returns all jobs and their raw return values.
public function toArray(): array
return
array<string, mixed>
Associative array of job names to their raw return values

Implementation

See Run for the concrete implementation.

Build docs developers (and LLMs) love