Render

Render lets you easily deploy and scale full stack applications. You can deploy your Inngest functions on Render using any web framework, including Next.js, Express, and FastAPI.

Below, we'll cover how to deploy:

  1. A production Inngest app
  2. Preview apps for each of your Git development branches

Before you begin

  • Create a web application that serves Inngest functions.
  • Test this web app locally with the Inngest dev server.

Deploy a production app on Render

  1. Deploy the web application that contains your Inngest functions to Render.
  2. Set the INNGEST_SIGNING_KEY and INNGEST_EVENT_KEY environment variables on your Render web app.
    • You can easily configure environment variables on a Render service through the Render dashboard.
    • You can find your production INNGEST_SIGNING_KEY here, and your production INNGEST_EVENT_KEYs here.
  3. Manually sync your Render web app with Inngest.

Automatically sync your app with Inngest

Each time you push changes to your Inngest functions, you need to sync your web app with Inngest. For convenience, you can automate these syncs from your CI/CD or from your API.

Automatically sync from your CI/CD

Automatically sync your app with Inngest using the Render Deploy Action, combined with a "curl command":

# .github/workflows/deploy.yaml
name: My Deploy

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to production
        uses: johnbeynon/render-deploy-action@v0.0.8
        with:
          service-id: ${{ secrets.MY_RENDER_SERVICE_ID }}
          api-key: ${{ secrets.MY_RENDER_API_KEY }}
          wait-for-success: true

  sync_inngest:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Register application to Inngest
       - run: |
            curl -X PUT ${{ secrets.APP_URL }}/api/inngest

The above GitHub Action requires the MY_RENDER_API_KEY, MY_RENDER_SERVICE_ID and APP_URL to be configured on your repository.

Automatically sync from your app

You app can self-register as part of its startup flow if it matches the following requirements:

  • Your application should run as a long-lived server instance (not serverless)
  • Your application should be deployed as a single node (not with auto scaled replicas)

The following Express.js code snippet showcases how to achieve self-register:

index.ts (Express.js)


// your express `app` definition stands here...

app.listen(PORT, async () => {
  console.log(`✅ Server started on localhost:${PORT}
➡️ Inngest running at http://localhost:${PORT}/api/inngest`);

  // Attempt to self-register the app after deploy
  if (process.env.RENDER_EXTERNAL_URL) {
    console.log(
      `Attempting self-register. Functions: `,
      functions.map((f) => f.name).join(', ')
    );
    const inngestURL = new URL('/api/inngest', process.env.RENDER_EXTERNAL_URL);
    const result = await fetch(inngestURL, {
      method: 'PUT',
    });
    await sleep(2000);
    try {
      const json = await result.json();
      console.log(
        `Register attempted:`,
        inngestURL.toString(),
        result.status,
        json
      );
    } catch (err) {
      console.log(
        `Register failed:`,
        inngestURL.toString(),
        result.status,
        result.body
      );
    }
  }
});

function sleep(t: number): Promise<void> {
  return new Promise((res) => {
    return setTimeout(res, t);
  });
}

The full code is available on GitHub

Set up preview apps on Render

What are preview apps?

Render lets you deploy work-in-progress versions of your apps using code in a Git development branch. Specifically, you can deploy:

  • Service previews: a temporary standalone instance of a single Render service.
  • Preview environments: a disposable copy of your production environment that can include multiple services and databases.

You can use Render's service previews and preview environments together with Inngest's branch environments.

Set up Inngest in preview apps

To use Inngest in a Render service preview or preview environment, follow these steps.

One-time setup:

  1. Follow Render's guides to enable either a service preview or a preview environment.
  2. In Inngest, create a branch environment INNGEST_SIGNING_KEY and a branch environment INNGEST_EVENT_KEY.
    • You can find your branch environment INNGEST_SIGNING_KEY here.
    • You can create a branch environment INNGEST_EVENT_KEY here.

Each time a preview app is deployed:

  1. Set the following environment variables on the preview service:

    • INNGEST_SIGNING_KEY and INNGEST_EVENT_KEY: Use the values from your Inngest branch environment.
    • INNGEST_ENV: Provide any value you want. This value will be used as the name of the branch in Inngest. As an option, you can use the value of RENDER_GIT_BRANCH.

    You can configure environment variables on the preview service through the Render dashboard. Alternatively, you can send a PUT or PATCH request via the Render API.

  2. Sync the app with Inngest.

    You can manually sync the app from the branch environments section of your Inngest dashboard, or automatically sync your app using a strategy described above.