POST /api/v2/flows/executions hanging on 202 with no event stream

Spun up a quick Node script to trigger an Architect flow via the REST API. The goal is simple: kick off a flow, wait for the result, and move on. I’m hitting POST /api/v2/flows/executions with a basic payload. The response comes back as 202 Accepted with an executionId. That part works. The problem is the subsequent GET request to poll the status. It keeps returning 200 with a status of “RUNNING” indefinitely. The flow itself is just a simple Set Variable action followed by a Return. No delays, no external API calls. I’ve checked the flow logs in the GC admin console, and the execution shows as “Completed” there with the correct output. So the flow ran, but the API isn’t reflecting that state change. I’m using the official @genesys/cloud-core-js SDK. Here’s the snippet:

const { Client } = require('@genesys/cloud-core-js');
const client = new Client();
// ... auth setup ...

const exec = await client.platformClient.flows.createFlowExecution({
 body: {
 flowId: '12345',
 inputs: { name: 'test' }
 }
});

console.log('Exec ID:', exec.id);
// Polling loop omitted for brevity, but it just calls getFlowExecution(exec.id)

I’ve tried adding a ?expand=logs query param to the GET request, but that just adds more noise to the response body without changing the status field. I’ve also tried waiting up to 30 seconds between polls. Nothing. The status stays RUNNING. Is there a known lag in the execution status API? Or am I missing a step to “commit” the execution state? I’ve checked the GitHub issues for the JS SDK, but nothing matches this specific behavior. It feels like a race condition in the status endpoint, but I can’t find any docs mentioning it. Anyone else hit this? The flow ID is valid, and I have the right permissions. Just stuck in this loop. I’m about to give up and just check the logs endpoint directly, but that seems hacky. What am I missing?

You’re polling the status endpoint, but you need the events endpoint. The 202 response includes an eventStreamUrl. Hit that with GET and listen for the execution.completed event instead of guessing when it finishes.

const eventsRes = await axios.get(eventStreamUrl, { params: { from: Date.now() } });
// parse eventsRes.data for status changes