Shubham
10/17/2025, 2:41 AMMarvin
10/17/2025, 2:41 AMMarvin
10/17/2025, 2:49 AMprefect cloud webhook create db-alerts \
    --description "DB alert inserts" \
    --template '{"event": "db.alert.inserted",
                 "resource": {"prefect.resource.id": "alert/{{ body.alert_id }}",
                              "table": "{{ body.table or \"alerts\" }}"},
                 "payload": {{ body | tojson }} }'alert_id{{ event.payload.alert_id }}prefect work-pool create my-cloud-run-pool --type cloud-run:push
  prefect work-pool provision-infra my-cloud-run-poolprefect deploy ./flows/alerts.py:process_alert --name process-alerts --work-pool my-cloud-run-poolfrom prefect.events import emit_event
def on_alert_insert(alert_id: str, metadata: dict):
    emit_event(
        event="db.alert.inserted",
        resource={"prefect.resource.id": f"alert/{alert_id}", "table": "alerts"},
        payload={"alert_id": alert_id, **metadata},
    )curl -X POST "$PREFECT_API_URL/flow_runs/" \
  -H "Authorization: Bearer $PREFECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"deployment_id": "<DEPLOYMENT_ID>", "parameters": {"alert_id": "123"}}'Marvin
10/17/2025, 2:49 AMShubham
10/17/2025, 2:53 AMMarvin
10/17/2025, 2:53 AMMarvin
10/17/2025, 2:55 AMprefect work-pool set-concurrency-limit my-pool 5prefect work-queue set-concurrency-limit my-queue 5 --pool my-poolfrom prefect.flows import Flow
  Flow.from_source(
      source="<https://github.com/org/repo>",
      entrypoint="flows/alerts.py:process_alert",
  ).deploy(
      name="process-alerts",
      work_pool_name="my-pool",
      concurrency_limit=5,  # per-deployment cap
  )for_each: ['prefect.resource.id']for_eachShubham
10/17/2025, 3:06 AMMarvin
10/17/2025, 3:06 AMMarvin
10/17/2025, 3:06 AMprefect cloud webhook create db-alerts \
    --description "DB alert inserts" \
    --template '{"event": "db.alert.inserted",
                 "resource": {"prefect.resource.id": "alert/{{ body.client_id }}/{{ body.alert_id }}",
                              "client_id": "{{ body.client_id }}",
                              "table": "alerts"},
                 "payload": {{ body | tojson }} }'db.alert.insertedfor_eachclient_idprefect work-pool create my-cloud-run-pool --type cloud-run:push
  prefect work-pool provision-infra my-cloud-run-poolprefect deploy ./flows/alerts.py:process_alerts_for_client \
    --name process-alerts \
    --work-pool my-cloud-run-poolprefect work-pool set-concurrency-limit my-cloud-run-pool 10prefect work-queue set-concurrency-limit my-queue 5 --pool my-cloud-run-poolfrom prefect.flows import Flow
  Flow.from_source(
      source="<https://github.com/org/repo>",
      entrypoint="flows/alerts.py:process_alerts_for_client",
  ).deploy(
      name="process-alerts",
      work_pool_name="my-cloud-run-pool",
      concurrency_limit=5,  # per-deployment cap
  )client_idsincealert_idfor_each: client_idMarvin
10/17/2025, 3:06 AMprefect cloud webhook rotate <WEBHOOK_ID>prefect-cloud.webhook.faileddb.alert.insertedclient_idclient_idShubham
10/17/2025, 4:08 AMMarvin
10/17/2025, 4:08 AMMarvin
10/17/2025, 4:09 AMprefect work-pool create db-events-pool --type cloud-run:push
    prefect work-pool provision-infra db-events-pool
    prefect work-pool set-concurrency-limit db-events-pool 100prefect work-pool set-concurrency-limit db-events-pool 100prefect work-queue set-concurrency-limit my-queue 100 --pool db-events-poolfrom prefect.flows import Flow
  Flow.from_source(
      source="<https://github.com/org/repo>",
      entrypoint="flows/alerts.py:process_alerts_for_client",
  ).deploy(
      name="process-alerts",
      work_pool_name="db-events-pool",
      concurrency_limit=100,
  )