Skip to content



The source code for the examples below can be found on GitHub.

Both the bash and docker providers allow workflows to host applications. To host apps within a workflow, you have to request the number of ports that your apps need. Use the ports property for that.

The actual port numbers will be passes to the workflow via environment variables PORT_0, PORT_1, etc.

Create a Python script with a FastAPI application:

from fastapi import FastAPI

app = FastAPI()

async def root():
    return {"message": "Hello World"}

Now, define the following workflow YAML file:

  - name: hello-fastapi
    provider: bash
    ports: 1
      - pip install fastapi uvicorn
      - uvicorn apps.hello_fastapi:app --port $PORT_0 --host


Don't forget to bind your application to the hostname.