{"repo":"upstash/workflow-py","free":true,"listed":false,"github":"https://github.com/upstash/workflow-py","clone":"git clone https://github.com/upstash/workflow-py.git","description":"Durable, Reliable and Performant Serverless Functions","language":"Python","stars":30,"topics":["qstash","upstash","workflow"],"license":"MIT","category":"workflow-automation","readme_excerpt":"Upstash Workflow SDK Upstash Workflow lets you write durable, reliable and performant serverless functions. Get delivery guarantees, automatic retries on failure, scheduling and more without managing any infrastructure. See the documentation for more details Quick Start Here, we will briefly showcase how you can get started with Upstash Workflow using FastAPI. Alternatively, you can check our quickstarts for different frameworks, including FastAPI and Next.js & FastAPI. Install First, create a new directory and set up a virtual environment: Then, install the required packages: Get QStash token Go to Upstash Console and copy the QSTASH TOKEN , set it in the .env file. Define a Workflow Endpoint To declare workflow endpoints, use the @serve.post decorator. Save the following code to main.py : In the example, you can see that steps are declared through the context object. The kinds of steps which are available are: context.run : execute a function context.sleep : sleep for some time context.sleep until : sleep until some timestamp context.call : make a third party call without consuming any runtime You can learn more about these methods from our documentation. Run the Server Upstash Workflow needs a public URL to orchestrate the workflow. Check out our Local Development guide to learn how to set up a local tunnel. Create the tunnel and set the UPSTASH WORKFLOW URL environment variable in the .env file with the public URL: Then, set the environment variables: Finally, run the ser","default_branch":null,"files":null,"tree":[],"storefront":"/r/upstash","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/upstash/workflow-py/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}