fix: save call metadata in gathered context for an api trigger outbou… (#566)

* fix: save call metadata in gathered context for an api trigger outbound call

* fix: handle workflow run update failures

* fix: format

* fix: pin integration workflow runs to published definitions

* test: expect text chat runtime configuration
This commit is contained in:
Sabiha Khan 2026-07-21 19:31:36 +05:30 committed by GitHub
parent 84d3cd0c03
commit ded23b1daa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 133 additions and 2 deletions

View file

@ -320,7 +320,7 @@ async def _execute_resolved_target(
# (e.g. Telnyx, Cloudonix); without them the URL contains "None/None" and
# the stream connection fails.
try:
await provider.initiate_call(
result = await provider.initiate_call(
to_number=request.phone_number,
webhook_url=webhook_url,
workflow_run_id=workflow_run.id,
@ -337,6 +337,25 @@ async def _execute_resolved_target(
detail=f"Failed to initiate call: {e}",
)
gathered_context = {
"provider": provider.PROVIDER_NAME,
"triggered_by": "api",
**(result.provider_metadata or {}),
}
if target.identifier_type == "trigger_path":
gathered_context["trigger_uuid"] = target.identifier_value
try:
await db_client.update_workflow_run(
run_id=workflow_run.id,
gathered_context=gathered_context,
)
except Exception as e:
logger.warning(
f"Call initiated for workflow run {workflow_run.id}, but failed to "
f"persist provider metadata: {e}"
)
logger.info(
f"Call initiated successfully for workflow run {workflow_run.id} "
f"via {target.identifier_type}={target.identifier_value}"