> Part of the walkerOS documentation. Project overview and full index: <https://www.walkeros.io/llms.txt>

# Deploy walkerOS to GCP Cloud Run

This guide deploys a walkerOS flow to Google Cloud Run, forwarding events to BigQuery.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* [Docker](https://docs.docker.com/get-docker/) installed (for local testing)
* [Node.js 18+](https://nodejs.org/) installed

## 1. Set Up BigQuery[​](#1-set-up-bigquery "Direct link to 1. Set Up BigQuery")

Follow the [GCP BigQuery setup](https://www.walkeros.io/docs/destinations/server/gcp.md#gcp-setup) to:

* Create a BigQuery dataset
* [Create a service account](https://www.walkeros.io/docs/destinations/server/gcp.md#create-service-account) with write permissions
* [Create the events table](https://www.walkeros.io/docs/destinations/server/gcp.md#create-table-query)

For local testing, [download a service account key](https://www.walkeros.io/docs/destinations/server/gcp.md#service-account-key). Production uses [Workload Identity](https://www.walkeros.io/docs/destinations/server/gcp.md#workload-identity).

### Enable Cloud Run API[​](#enable-cloud-run-api "Direct link to Enable Cloud Run API")

```
gcloud services enable run.googleapis.com
```

## 2. Bundle the Flow[​](#2-bundle-the-flow "Direct link to 2. Bundle the Flow")

Install the CLI and bundle the flow with a Dockerfile:

```
npm install -g @walkeros/cli



# Set your environment variables

export GCP_PROJECT_ID="your-project-id"

export BQ_DATASET="walkerOS"

export BQ_TABLE="events"

export BQ_LOCATION="EU"



# Bundle the flow and generate Dockerfile

walkeros bundle https://www.walkeros.io/flows/gcp-bigquery.json --dockerfile
```

This creates `dist/bundle.mjs` and `dist/Dockerfile`.

Variable substitution

The flow uses `${VARIABLE}` syntax. During bundling, these are replaced with your environment variable values. Required: `GCP_PROJECT_ID`. Optional with defaults: `BQ_DATASET` (walkerOS), `BQ_TABLE` (events), `BQ_LOCATION` (EU).

## 3. Test Locally with Docker[​](#3-test-locally-with-docker "Direct link to 3. Test Locally with Docker")

Before deploying, verify everything works locally:

```
# Run locally (uses key file for auth)

docker run --rm \

  -p 8080:8080 \

  -v $(pwd)/dist/bundle.mjs:/app/flow/bundle.mjs:ro \

  -v $(pwd)/sa-bigquery.json:/app/sa-bigquery.json:ro \

  -e GOOGLE_APPLICATION_CREDENTIALS=/app/sa-bigquery.json \

  walkeros/flow:next
```

In another terminal, send a test event:

```
curl -X POST http://localhost:8080/collect \

  -H "Content-Type: application/json" \

  -d '{

    "name": "page view",

    "data": {

      "title": "Test Page",

      "path": "/test"

    }

  }'
```

Expected response:

```
{ "success": true, "timestamp": 1234567890 }
```

Check BigQuery for the event:

```
bq query --use_legacy_sql=false \

  "SELECT * FROM walkerOS.events WHERE DATE(timestamp) = CURRENT_DATE() ORDER BY timestamp DESC LIMIT 5"
```

## 4. Deploy to Cloud Run[​](#4-deploy-to-cloud-run "Direct link to 4. Deploy to Cloud Run")

The Dockerfile was generated by `--dockerfile`. Cloud Run uses Workload Identity, so no credentials file is needed in the image.

Deploy with the service account attached:

```
cd dist



gcloud run deploy walkeros-flow \

  --source . \

  --port 8080 \

  --region europe-west1 \

  --allow-unauthenticated \

  --service-account=walkeros-flow@YOUR_PROJECT_ID.iam.gserviceaccount.com \

  --memory 512Mi \

  --cpu 1 \

  --min-instances 0 \

  --max-instances 10
```

Note the service URL from the output (e.g., `https://walkeros-flow-xxx-ew.a.run.app`).

## 5. Verify Deployment[​](#5-verify-deployment "Direct link to 5. Verify Deployment")

### Health Check[​](#health-check "Direct link to Health Check")

```
curl https://walkeros-flow-xxx-ew.a.run.app/health
```

### Send Test Event[​](#send-test-event "Direct link to Send Test Event")

```
curl -X POST https://walkeros-flow-xxx-ew.a.run.app/collect \

  -H "Content-Type: application/json" \

  -d '{

    "name": "page view",

    "data": {

      "title": "Production Test",

      "path": "/"

    }

  }'
```

### Query BigQuery[​](#query-bigquery "Direct link to Query BigQuery")

```
bq query --use_legacy_sql=false \

  "SELECT name, data, timestamp FROM walkerOS.events WHERE DATE(timestamp) = CURRENT_DATE() ORDER BY timestamp DESC LIMIT 5"
```

## Next Steps[​](#next-steps "Direct link to Next Steps")

* [Configure event mapping](https://www.walkeros.io/docs/mapping.md) to transform events before sending to BigQuery
* [Add more destinations](https://www.walkeros.io/docs/destinations.md) to forward events to multiple services

## Cleanup[​](#cleanup "Direct link to Cleanup")

To remove all created resources:

* Delete the Cloud Run service (`gcloud run services delete walkeros-flow --region europe-west1`)
* [Clean up BigQuery resources](https://www.walkeros.io/docs/destinations/server/gcp.md#cleanup)
* Delete local files (`dist/`, `sa-bigquery.json`)
