https://dagster.io/ logo
#dagster-support
Title
# dagster-support
d

DE-2

04/07/2022, 3:18 PM
Guys, how do we pass a variable value from one job to the other? Let's say I have a job which writes a file to folder, I want to store another file using pipeline 2 in the same folder created by pipeline 1. Shall I use assets and attach metadata which can be fetched by the downstream pipelines?
c

claire

04/07/2022, 7:15 PM
Yep, one possible way you could do this is attach the file folder path as metadata in the
AssetMaterialization
yielded in pipeline 1. Then, in pipeline 2, you could do something like this in an op:
Copy code
context.instance.get_event_records(EventRecordsFilter(DagsterEventType.ASSET_MATERIALIZATION, asset_key), limit=1)
to fetch the latest folder created in pipeline 1.
d

DE-2

04/08/2022, 1:34 AM
Thanks @claire will try this.