<@U080CA00GRH> :thread: on transaction data
# pacc-nov-19-20-2024
e
@Ivan Vasiunyk ๐Ÿงต on transaction data
๐Ÿฆœ 1
gratitude thank you 1
You can set arbitrary data in the transaction, for example a transaction ID. Docs here
๐Ÿฆœ 1
Set a key:
Copy code
@flow
def pipeline(filename: str, contents: str):
    with transaction() as txn:
        txn.set("filename", filename)
        write_file(filename, contents)
Consume it:
Copy code
@write_file.on_rollback
def del_file(txn):
    "Deletes file."
    os.unlink(txn.get("filename"))