Hey everyone,
I’m hitting a weird snag trying to trigger an Architect flow from a simple Node.js script. The goal is just to start a flow that updates a contact’s custom attributes based on some external webhook data.
Here’s the basic setup:
const axios = require('axios');
async function triggerFlow() {
try {
const response = await axios.post(
`${genesysBaseUrl}/api/v2/flows/executions`,
{
flowId: 'my-flow-id-here',
parameters: {
contactId: '12345',
action: 'update'
}
},
{
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
}
);
console.log('Flow started:', response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
}
Most of the time it works fine. But if I run this script twice in quick succession (like, less than 2 seconds apart), the second call bombs out with a 409 Conflict. The error payload looks like this:
{
"code": "conflict",
"message": "Flow execution already in progress for this context",
"status": 409
}
I thought maybe I needed to pass a unique executionId or something in the body to separate the requests, but the docs for /api/v2/flows/executions don’t mention any required ID fields for the POST body, just flowId and optional parameters.
Is there a rate limit or a deduplication window I’m missing? Or do I need to structure the JSON payload differently to allow parallel executions?
Thanks for the help.