Not Receiving Messages Back on Workflow Python

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fastapi, node.js, python
Domain
backend, devtools

Research direction

Start with the FastAPI handler registered through Serve(app), then run the reported /hello-world request alongside npx @upstash/qstash-cli dev and inspect the workflow execution path around context.run("step1") and context.run("step2"). Done means determining whether both steps execute locally and identifying how their output or execution status is surfaced.

Written by the indexing model from the issue text.

Description

Hi! I like the Upstash product and I've used it in my past projects, but now that I'm trying Upstash Workflow, I can't seem to get it working locally.

Here's my code:

import os

from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from upstash_workflow import AsyncWorkflowContext
from upstash_workflow.fastapi import Serve

load_dotenv("../.env.local")

app = FastAPI()
serve = Serve(app)


@serve.post("/hello-world")
async def call(context: AsyncWorkflowContext[str]) -> None:
    print("RECEIVED REQUEST")
    input = context.request_payload

    async def _step1() -> str:
        output = "hello1"
        print("step 1 input", input, "output", output)
        return output

    result1: str = await context.run("step1", _step1)

    async def _step2() -> str:
        output = "hello2"
        print("step 2 input", result1, "output", output)
        return output

    output_step2: str = await context.run("step2", _step2)
    print("step 2 output", output_step2)

I'm running Upstash locally using npx @upstash/qstash-cli dev

When I send a request to the hello-world endpoint, all I see printed out is:

RECEIVED REQUEST
INFO:     127.0.0.1:62186 - "POST /hello-world HTTP/1.1" 200 OK

The response is:

{
    "workflowRunId": "wfr_pEZC6_EE0iEfiaYPHz00X"
}

In my FastAPI application terminal, I don't see "step 1 input", "step 2 input", or "step 2 output". I also don't see any additional logs on the Upstash terminal when I make requests.

How do I know if step1 or step2 were actually run?

Dominant language
JavaScript
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from upstash/qstash-cli

All issues in upstash/qstash-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.