Bedrock PromptFlow call from Lambda results in 'No input provided for FlowInput node FlowInputNode'

0

Thanks to Vadim I've gotten this far. We're doing a POC and we're looking to call certain prompt flows via Lambda from our Bedrock Agent.

Here is the image of the Prompt Flow: Enter image description here

This is the image of the error: Enter image description here

Response { "errorMessage": "An error occurred (dependencyFailedException) when calling the InvokeFlow operation: No input provided for FlowInput node FlowInputNode", "errorType": "EventStreamError", "requestId": "2022b38d-a281-4cdd-acff-9f9fd4f5a95f", "stackTrace": [ " File \"/var/task/dummy_lambda.py\", line 48, in lambda_handler\n res = call_first_prompt_flow(input_text)\n", " File \"/var/task/bedrock_prompt_flows.py\", line 38, in call_first_prompt_flow\n for event in response.get(\"responseStream\"):\n", " File \"/opt/python/botocore/eventstream.py\", line 592, in __iter__\n parsed_event = self._parse_event(event)\n", " File \"/opt/python/botocore/eventstream.py\", line 608, in _parse_event\n raise EventStreamError(parsed_response, self._operation_name)\n" ] }

Thanks to someone in the comments for the answer! Enter image description here

Antoine
asked 2 months ago192 views
2 Answers
2
Accepted Answer

I believe that the issue here is that the prompt flow editor names the input node "FlowInputNode" not "FlowInput", which is the name used in the sample. The only way I found to validate this was to introduce an error in the input handing in the editor. The editor will print an error message with the input node name.

Andrew
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
EXPERT
reviewed 2 months ago
  • Hi Andrew! I've edited the post to show the results of your recommendation. It appears your craftiness is to be commended! :) Thanks, I owe you one!

2

Hi,

The error you're encountering, EventStreamError, is related to the AWS Bedrock service, where it states, "No input provided for FlowInput node FlowInputNode." This suggests that the input required by the FlowInputNode was not correctly passed to the flow.

To resolve this issue, you should ensure that the input you're providing in the inputs parameter contains the expected fields and values that the FlowInputNode expects. Here are a few things to check:

  • Check the Input Format: Ensure that the inputs field in the invoke_flow function is structured correctly. The FlowInputNode expects specific data, which must match the format and type defined in the flow.
  • Validate the Content: Make sure that user_input or whatever data is being passed as content is properly formed and not empty.
  • Flow Identifier: Double-check the flowIdentifier and flowAliasIdentifier to ensure they are correctly pointing to the flow you intend to call.

Here’s a general structure that you can refer to for debugging:

inputs=[ { "content": { "document": user_input, # Make sure 'user_input' is valid and contains expected content }, "nodeName": "FlowInputNode", # Double-check the node name "nodeOutputName": "document" # Ensure this matches the expected output node } ]

You can check the content of this worshop as an example. https://github.com/aws-samples/amazon-bedrock-samples/blob/0e205257ab83aa0e65f5ee5a062f25193e53c272/introduction-to-bedrock/Getting_started_with_Prompt_Management_Flows.ipynb#L497

I would suggest to open a case. Our support team should be able to assist you as well.

profile pictureAWS
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • Hi! I added an image of the PromptFlow in my post description. Thank you for your comment. It appears correct but have a look if you can!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions