Error while connecting whatsapp node to Https node (Flowise chatbot)

:bullseye: What is your goal?

Connection setup of whatsapp node to Flowise chatbot (via https node).
Input via whatsapp should enable image file upload and pass to http node and return the analysis of the file

:thinking: What is the problem & what have you tried?

While testing the setup, hit the following error. Suspect the https configuration is not setup properly. I am not sure about what to input at the various fields of the https node. It is suppose to able to receive files from whatsapp trigger node and send back the analysis result. I had attached the configuration setup image of the http node, especially the header, body fields, not sure what are the correct values.

Anyone can help ? Thanks

:clipboard: Error messages or input/output bundles

AT Https node Error Msg below:
<DataError Request failed with status code 400 {“statusCode”:400,“success”:false,“message”:“Unexpected token ‘n’, "null" is not valid JSON”,“stack”:{}}>

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hey Shirley!

To better help you, it would definitely help if you could include an example payload (the data) of your Whatsapp Cloud module

I do believe it has to do with the way you are mapping the File, however, I am not able to determine with precision because we would need to check the payload.

If you put an image with the info you get (with a test, not live data) I might be able to lend you a hand

Yes, attached is the image file in .png format which i have sent to whatsapp.

Before configuring whatsapp nodes, I tested in flowise chatbot by passing same .png file and it worked. The chat is supposed to analysed the image file (receipt) and return its total and extracted information in the chatbot.

I wanted to integrate whatsapp node into the flowise chatbot so that i can pass the image file to whatsapp and returns the resutls from whatsapp node as well.

I saw the send whatsapp node output, i think it is passing correct input file to https node. I think the problem lies within the https node itself, suspect one of the configuration is not correct.

I had attached the snapshot of the config and value of https node in first post. Also, i had post a snapshot of the whatsapp watch events node (just authenthication).

Note: The whatsapp node integration with https node works successfully with pure text (i tested out).

however, only if the input is in file that it fails. Hope anyone can help. Let me know if more info required.

Welcome to the Make community!

Does the Module Require You to Map File Data?

Did you forget to download the file using the file’s link/URL? If it’s not downloaded to the scenario, the next module can’t access the file binary data (contents).

To do this, you can try using the WhatsApp Business Cloud “Download a Media” module —

Downloads a media by its ID.

For more information about the “Download a Media” module and the WhatsApp Business Cloud app, see the corresponding Integrations page and the Help Centre documentation.

For more information, see Working with files - Help Center.

More Than One File?

If you have an Array of multiple file URLs, you can use an Iterator module, and map the resulting bundle value/URL to the “Get a file” module.

To download multiple files before proceeding to the next module, you can use an Array Aggregator.

Combining Bundles Using Aggregators

Every result/item from some module types (like Trigger / Iterator / List / Search / Match modules) can potentially and likely output more than one bundle. These multiple bundles will individually run subsequent modules once per bundle, which is not optimal in most cases:

  • one operation per bundle per module, which could lead to…
  • use of multiple credits per bundle per module (some modules use more than one credit)
View example screenshots

Aggregator Example

The “Search Rows” module runs one time, returning 999 results (999 bundles).

  • Without Aggregator: the tools module run 999 times (999 operations)


    (and if there are more modules, they run 999 times each)

  • With Aggregator: the tools module only runs 1 time (1 operation)

:warning: Warning: :police_car_light:
This can easily use your entire quota of credits if you are not careful or fail to understand this concept.

To “combine” multiple bundles into a single variable, so that you can process all of the items in a single operation, you’ll need to use an aggregator. Aggregators is a type of module that accumulates bundles and outputs one bundle (unless you are using “Group By”). An example of a commonly-used aggregator module is the Array aggregator module.

You can find out more about some other aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Mapping a Complex (Collection) Structure Into an Array Field

The Array Aggregator module is very powerful because it allows you to build a new complex array of collections that matches a later module’s array field to map multiple items (collections) to it. Such fields initially may allow you to manually add individual items, but toggle the “Map” switch on, and you can map an array variable (from an Array Aggregator) containing multiple collections.

Simply select the respective “Target structure type” in an Array Aggregator module.

As you can see from the above example, the “Map” toggle on complex fields are used when you have an array variable (like from an array aggregator).

:clipboard: Note: :light_bulb:
Other combinations of modules may also allow you to generate an array that matches a future module field’s array structure, like “Aggregate to JSON + Parse JSON”, or “Create JSON + Parse JSON”, but this is an advanced topic.

Question: Are you mapping your array into a field that accepts more than one item/collection?

For more information, see “Mapping with arrays” in the Help Centre. I also suggest going through the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! If you are still having trouble, please provide more details.

@samliew

I tried with the whatsapp download the file module and it works by passing the url link to the http app in flowise. Thanks for your help!

For the output of the custom app, it passes a json structure output of the extracted receipt information to whatsapp send a message node. However, it also includes many other info. e.g chatid and other info which is not only the direct output of the http app chatbot. Wondering if there are anyway to filter away the unnecessary information out… Thanks

No problem, glad I could help with your question:
"Error while connecting whatsapp node to Https node (Flowise chatbot)"   :tada:

1. Which was the most helpful post in this thread?

The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep this forum organised. :folded_hands:

This marks the topic as solved, so that others can:

  • save time when browsing the latest activity on the forum, and
  • quickly jump to the solution in this topic (from the top)

To do this, simply click the checkbox at the bottom of the post that is the most helpful in answering your question.

a screenshot of post menu options at the bottom of each post
Note: :light_bulb:
:link: Here’s a magic link to a list of your other “unsolved” topics— status:unsolved

2. Have you learnt something new?

Do bookmark this topic so you can easily find and return to this topic in future.

a screenshot of bookmark link at the bottom of the topic

Note: :light_bulb:
:link: Here’s a magic link to a list of your bookmarks— /my/activity/bookmarks

3. Have a different question? Start a new topic.

Do you have a question that is not about "Error while connecting whatsapp node to Https node (Flowise chatbot)"? Please start a new topic.

Creating a new topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!

@samliew