Skip to content

Commit c34801a

Browse files
committed
Update passing-data.md
1 parent c26c029 commit c34801a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/defining-workflows/passing-data.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ use Workflow\WorkflowStub;
1111

1212
$workflow = WorkflowStub::make(MyWorkflow::class);
1313
$workflow->start('world');
14-
while ($workflow->running());
15-
$workflow->output();
16-
=> 'Hello, world!'
1714
```
1815

1916
It will be passed as arguments to the workflow's `execute()` method.
@@ -53,6 +50,15 @@ import PassingDataSimulator from '@site/src/components/PassingDataSimulator';
5350

5451
In general, you should only pass small amounts of data in this manner. Rather than passing large amounts of data, you should write the data to the database, cache or file system. Then pass the key or file path to the workflow and activities. The activities can then use the key or file path to read the data.
5552

53+
## Output
54+
55+
Once the workflow has completed, you can retrieve the output using the `output()` method.
56+
57+
```php
58+
$workflow->output();
59+
=> 'Hello, world!'
60+
```
61+
5662
## Models
5763

5864
Passing in models works similarly to `SerializesModels`.

0 commit comments

Comments
 (0)