feat: NAT egress proxy for webhook delivery via static IPs (#5392)

This commit is contained in:
Shuchang Zheng 2026-04-06 13:35:33 -07:00 committed by GitHub
parent e49a84daa9
commit 49e2bbd7b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 27 deletions

View file

@ -12,7 +12,6 @@ from datetime import UTC, datetime, timedelta
from hashlib import sha256
from typing import Any, Literal, cast
import httpx
import structlog
from sqlalchemy.exc import IntegrityError, SQLAlchemyError
@ -4576,13 +4575,14 @@ class WorkflowService:
headers=signed_data.headers,
)
try:
async with httpx.AsyncClient() as client:
resp = await client.post(
url=workflow_run.webhook_callback_url,
data=signed_data.signed_payload,
headers=signed_data.headers,
timeout=httpx.Timeout(30.0),
)
resp = await app.AGENT_FUNCTION.deliver_webhook(
url=workflow_run.webhook_callback_url,
payload=signed_data.signed_payload,
headers=signed_data.headers,
timeout_seconds=30.0,
organization_id=workflow_run.organization_id,
run_id=workflow_run.workflow_run_id,
)
if resp.status_code >= 200 and resp.status_code < 300:
LOG.info(
"Webhook sent successfully",