FlowiseAI/Flowise

Need Help Resolving Persistent 409 Conflict Error: "Payloads Already Received" in API Call

Closed this issue · 2 comments

Hi,

I'm encountering a recurring 409 Conflict {"detail":"Payloads already received"} error when trying to make GET requests to an API in Flowise using a custom tool.

Details:

  • Tool Description: Custom tool in Flowise to call an API endpoint for retrieving token details.
  • JS Function: Here’s the function I’m using in the tool:
    const fetch = require('node-fetch');
    
    async function searchEduChain(query) {
        const url = `https://edu-chain-testnet.blockscout.com/api/v2/search?q=${query}`;
        const options = {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            }
        };
    
        try {
            const response = await fetch(url, options);
            const data = await response.json();
            return data;
        } catch (error) {
            console.error(error);
            return '';
        }
    }
  • Issue: Each time I call the API, I receive the 409 Conflict error message "Payloads already received", indicating it thinks it's a duplicate request. I’ve tried various methods to ensure unique requests (timing adjustments, adding unique identifiers, etc.) but no luck.

Error Details (Server Log):

Error submitting tool outputs: BadRequestError: 400 Missing required parameter: 'tool_outputs[0].output'.

Error: Failed to batch create run: 409 Conflict {"detail":"Payloads already received"}

Tried Solutions:

  1. Implemented unique request IDs (where possible).
  2. Checked for any caching on the server side and implemented delays between calls.
  3. Verified that each request payload was distinct.

Any insights on handling this error in Flowise specifically, or suggestions on other ways to prevent the 409 Conflict error, would be greatly appreciated. Thanks in advance!

@HenryHengZJ @toi500

I dont think you need to wrap into a function: searchEduChain
Example: https://docs.flowiseai.com/integrations/langchain/tools/custom-tool

Have you tested if the API you are calling working outside of Flowise?

Yes, I have tested the API outside of the Flowise instance, and it's working fine. However, when I create the JavaScript function, it causes the same error repeatedly. Thanks, I'll find a way to fix it.