Skip to content

Empty workflow run output, or: how to get the task output of a workflow run? #1989

Answered by mrkaye97
sanzoghenzo asked this question in Q&A
Discussion options

You must be logged in to vote

yes, definitely - in that case, it definitely makes sense to return the ID and then poll for the result! What you're doing should work, this definitely looks like a bug on our end on the REST API. Fortunately, the gRPC API should help here and will be less prone to race conditions, which also pop up in the REST API. Here's an example based on what you have now

status = await hatchet.runs.aio_get_status(workflow_run_id)

if status == V1TaskStatus.COMPLETED:
    ref = hatchet.runs.get_run_ref(workflow_run_id)
    
    try:
        ## set this timeout to whatever you want
        async with asyncio.timeout(3): 
            return await ref.aio_result()
    except asyncio.TimeoutError:
        

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@mrkaye97
Comment options

@sanzoghenzo
Comment options

@mrkaye97
Comment options

Answer selected by sanzoghenzo
@sanzoghenzo
Comment options

@mrkaye97
Comment options

@mrkaye97
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants