Close Menu
    Main Menu
    • Home
    • News
    • Tech
    • Robotics
    • ML & Research
    • AI
    • Digital Transformation
    • AI Ethics & Regulation
    • Thought Leadership in AI

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Reworking enterprise operations: 4 high-impact use circumstances with Amazon Nova

    October 16, 2025

    Your information to Day 2 of RoboBusiness 2025

    October 16, 2025

    Night Honey Chat: My Unfiltered Ideas

    October 16, 2025
    Facebook X (Twitter) Instagram
    UK Tech InsiderUK Tech Insider
    Facebook X (Twitter) Instagram
    UK Tech InsiderUK Tech Insider
    Home»Machine Learning & Research»DoWhile loops now supported in Amazon Bedrock Flows
    Machine Learning & Research

    DoWhile loops now supported in Amazon Bedrock Flows

    Oliver ChambersBy Oliver ChambersSeptember 26, 2025No Comments11 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    DoWhile loops now supported in Amazon Bedrock Flows
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    At present, we’re excited to announce help for DoWhile loops in Amazon Bedrock Flows. With this highly effective new functionality, you’ll be able to create iterative, condition-based workflows instantly inside your Amazon Bedrock flows, utilizing Immediate nodes, AWS Lambda features, Amazon Bedrock Brokers, Amazon Bedrock Flows inline code, Amazon Bedrock Information Bases, Amazon Easy Storage Service (Amazon S3), and different Amazon Bedrock nodes throughout the loop construction. This function avoids the necessity for advanced workarounds, enabling refined iteration patterns that use the total vary of Amazon Bedrock Flows parts. Duties like content material refinement, recursive evaluation, and multi-step processing can now seamlessly combine AI mannequin calls, customized code execution, and data retrieval in repeated cycles. By offering loop help with various node sorts, this function simplifies generative AI software growth and accelerates enterprise adoption of advanced, adaptive AI options.

    Organizations utilizing Amazon Bedrock Flows can now use DoWhile loops to design and deploy workflows for constructing extra scalable and environment friendly generative AI functions totally throughout the Amazon Bedrock atmosphere whereas attaining the next:

    • Iterative processing – Execute repeated operations till particular situations are met, enabling dynamic content material refinement and recursive enhancements
    • Conditional logic – Implement refined decision-making inside flows primarily based on AI outputs and enterprise guidelines
    • Advanced use instances – Handle multi-step generative AI workflows that require repeated execution and refinement
    • Builder-friendly – Create and handle loops by way of each the Amazon Bedrock API and AWS Administration Console within the traces
    • Observability – Make use of seamless monitoring of loop iterations, situations, and execution paths

    On this put up, we focus on the advantages of this new function, and present learn how to use DoWhile loops in Amazon Bedrock Flows.

    Advantages of DoWhile loops in Amazon Bedrock Flows

    Utilizing DoWhile loops in Amazon Bedrock Flows presents the next advantages:

    • Simplified movement management – Create refined iterative workflows with out advanced orchestration or exterior companies
    • Versatile processing – Allow dynamic, condition-based execution paths that may adapt primarily based on AI outputs and enterprise guidelines
    • Enhanced growth expertise – Assist customers construct advanced iterative workflows by way of an intuitive interface, with out requiring exterior workflow administration

    Answer overview

    Within the following sections, we present learn how to create a easy Amazon Bedrock movement utilizing Do-while loops with Lambda features. Our instance showcases a sensible software the place we assemble a movement that generates a weblog put up on a given subject in an iterative method till sure acceptance standards are fulfilled. The movement demonstrates the ability of mixing several types of Amazon Bedrock Flows nodes inside a loop construction, the place Immediate nodes generate and fine-tune the weblog put up, Inline Code nodes enable writing customized Python code to research the outputs, and S3 Storage nodes allow storing every model of the weblog put up throughout the course of for reference. The DoWhile loop continues to execute till the standard of the weblog put up meets the situation set within the loop controller. This instance illustrates how totally different movement nodes can work collectively inside a loop to progressively rework information till desired situations are met, offering a basis for understanding extra advanced iterative workflows with numerous node combos.

    Conditions

    Earlier than implementing the brand new capabilities, be sure to have the next:

    After these parts are in place, you’ll be able to proceed with utilizing Amazon Bedrock Flows with DoWhile loop capabilities in your generative AI use case.

    Create your movement utilizing DoWhile Loop nodes

    Full the next steps to create your movement:

    1. On the Amazon Bedrock console, select Flows beneath Builder instruments within the navigation pane.
    2. Create a brand new movement, for instance, dowhile-loop-demo. For detailed directions on making a movement, see Amazon Bedrock Flows is now usually out there with enhanced security and traceability.
    3. Add a DoWhile loop node.
    4. Add further nodes in response to the answer workflow (mentioned within the subsequent part).

    Amazon Bedrock supplies totally different node sorts to construct your immediate movement. For this instance, we use a DoWhile Loop node for calling several types of nodes for a generative AI-powered software, which creates a weblog put up on a given subject and checks the standard in each loop. There’s one DoWhile Loop node within the movement. This new node kind is on the Nodes tab within the left pane, as proven within the following screenshot.

    DoWhile loop workflow

    A DoWhile loop consists of two components: the loop and the loop controller. The loop controller validates the logic for the loop and decides whether or not to proceed or exit the loop. On this instance, it’s executing Immediate, Inline Code, S3 Storage nodes every time the loop is executed.

    Let’s undergo this movement step-by-step, as illustrated within the previous screenshot:

    1. A person asks to put in writing a weblog put up on a particular subject (for instance, utilizing the next immediate: {“subject”: “AWS Lambda”, “Viewers”: “Chief Expertise Officer”, “word_count”:”500}). This immediate is distributed to the Immediate node (Content_Generator).
    2. The Immediate node (Content_Generator) writes a weblog put up primarily based on the immediate utilizing one of many Amazon Bedrock supplied LLMs (similar to Amazon Nova or Anthropic’s Claude) and is distributed to the Loop Enter node. That is the entry level to the DoWhile Loop node.
    3. Three steps occur in tandem:
      1. The Loop Enter node forwards the weblog put up content material to a different Immediate node (Blog_Analysis_Rating) for score the put up primarily based on standards talked about as a part of the immediate. The output of this Immediate node is JSON code like the next instance. The output of a Immediate node is at all times of kind String. You possibly can modify the immediate to get several types of output in response to your wants. Nevertheless, it’s also possible to ask the LLM to output a single score quantity.
        {
          "overall_rating": 8.5,
          "category_ratings": {
            "clarity_and_readability": 9,
            "value_to_target_audience": 8,
            "engagement_level": 8,
            "technical_accuracy": 9
          }

      2. The weblog put up is distributed to the movement output throughout each iteration. That is the ultimate model at any time when the loop situation will not be met (exiting the loop) or the tip of most loop iterations.
      3. On the similar time, the output of the earlier Immediate node (Content_Generator) is forwarded to a different Immediate node (Blog_Refinement) by the Loop Enter node. This node recreates or modifies the weblog put up primarily based on the suggestions from the evaluation.
    4. The output of the Immediate node (Blog_Analysis_Rating) is fed into the Inline Code node to extract the required score and return that as a quantity or different info required for checking the situation contained in the loop controller as enter variables (for instance, a score).
    def __func(variable):
     return float(variable["overall_rating"])
    __func(variable)

    Python code contained in the Inline Code have to be handled as untrusted, and applicable parsing, validation, and information dealing with must be applied.

    1. The output of the Inline Code node is fed into the loop situation contained in the loop controller to validate towards the situation we arrange contained in the proceed loop. On this instance, we’re checking for a score lower than or equal to 9 for the generated weblog put up. You possibly can examine as much as 5 situations. Moreover, a most loop iterations parameter makes positive that loop doesn’t proceed infinitely.
    2. The step consists of two components:
      1. A Immediate node (Blog_Refinement) forwards the newly generated weblog put up to loopinput contained in the loop controller.
      2. The loop controller shops the model of the put up in Amazon S3 for future reference and evaluating the totally different variations generated.
    3. This path will execute if one of many situations is met contained in the proceed loop and most loop iterations. If this continues, then the brand new modified weblog put up from earlier is forwarded to the enter discipline within the Loop Enter node as LoopInput and the loop continues.
    4. The ultimate output is produced after the DoWhile loop situation is met or most variety of iterations are accomplished. The output will probably be closing model of the weblog put up.

    You possibly can see the output as proven within the following screenshot. The system additionally supplies entry to node execution traces, providing detailed insights into every processing step, real-time efficiency metrics, and highlighting points which will have occurred throughout the movement’s execution. Traces may be enabled utilizing an API and despatched to an Amazon CloudWatch log. Within the API, set the enableTrace discipline to true in an InvokeFlow request. Every flowOutputEvent within the response is returned alongside a flowTraceEvent.

    You may have now efficiently created and executed an Amazon Bedrock movement utilizing DoWhile Loop nodes. You may also use Amazon Bedrock APIs to programmatically execute this movement. For extra particulars on learn how to configure flows, see Amazon Bedrock Flows is now usually out there with enhanced security and traceability.

    Issues

    When working with DoWhile Loop nodes in Amazon Bedrock Flows, the next are the essential issues to notice:

    • DoWhile Loop nodes don’t help nested loops (loops inside loops)
    • Every loop controller can consider as much as 5 enter situations for its exit standards
    • A most iteration restrict have to be specified to assist forestall infinite loops and allow managed execution

    Conclusion

    The combination of DoWhile loops in Amazon Bedrock Flows marks a major development in iterative workflow capabilities, enabling refined loop-based processing that may incorporate Immediate nodes, Inline Code nodes, S3 Storage nodes, Lambda features, brokers, DoWhile Loop nodes, and Information Base nodes. This enhancement responds on to enterprise prospects’ wants for dealing with advanced, repetitive duties inside their AI workflows, serving to builders create adaptive, condition-based options with out requiring exterior orchestration instruments. By offering help for iterative processing patterns, DoWhile loops assist organizations construct extra refined AI functions that may refine outputs, carry out recursive operations, and implement advanced enterprise logic instantly throughout the Amazon Bedrock atmosphere. This highly effective addition to Amazon Bedrock Flows democratizes the event of superior AI workflows, making iterative AI processing extra accessible and manageable throughout organizations.

    DoWhile loops in Amazon Bedrock Flows at the moment are out there in all of the AWS Areas the place Amazon Bedrock Flows is supported, aside from the AWS Gov Cloud (US) Area. To get began, open the Amazon Bedrock console or Amazon Bedrock APIs to start constructing flows with Amazon Bedrock Flows. To be taught extra, confer with Create your first movement in Amazon Bedrock and Observe every step in your movement by viewing its hint in Amazon Bedrock.

    We’re excited to see the modern functions you’ll construct with these new capabilities. As at all times, we welcome your suggestions by way of AWS re:Put up for Amazon Bedrock or your regular AWS contacts. Be a part of the generative AI builder neighborhood at neighborhood.aws to share your experiences and be taught from others.


    Concerning the authors

    Shubhankar SumarShubhankar Sumar is a Senior Options Architect at AWS, the place he focuses on architecting generative AI-powered options for enterprise software program and SaaS firms throughout the UK. With a powerful background in software program engineering, Shubhankar excels at designing safe, scalable, and cost-effective multi-tenant programs on the cloud. His experience lies in seamlessly integrating cutting-edge generative AI capabilities into current SaaS functions, serving to prospects keep on the forefront of technological innovation.

    Jesse MandersJesse Manders is a Senior Product Supervisor on Amazon Bedrock, the AWS Generative AI developer service. He works on the intersection of AI and human interplay with the aim of making and bettering generative AI services and products to fulfill our wants. Beforehand, Jesse held engineering group management roles at Apple and Lumileds, and was a senior scientist in a Silicon Valley startup. He has an M.S. and Ph.D. from the College of Florida, and an MBA from the College of California, Berkeley, Haas Faculty of Enterprise.

    Eric Li is a Software program Improvement Engineer II at AWS, the place he builds core capabilities for Amazon Bedrock and SageMaker to help generative AI functions at scale. His work focuses on designing safe, observable, and cost-efficient programs that assist builders and enterprises undertake generative AI with confidence. He’s enthusiastic about advancing developer experiences for constructing with massive language fashions, making it simpler to combine AI into production-ready cloud functions.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Oliver Chambers
    • Website

    Related Posts

    Reworking enterprise operations: 4 high-impact use circumstances with Amazon Nova

    October 16, 2025

    Reinvent Buyer Engagement with Dynamics 365: Flip Insights into Motion

    October 16, 2025

    From Habits to Instruments – O’Reilly

    October 16, 2025
    Top Posts

    Evaluating the Finest AI Video Mills for Social Media

    April 18, 2025

    Utilizing AI To Repair The Innovation Drawback: The Three Step Resolution

    April 18, 2025

    Midjourney V7: Quicker, smarter, extra reasonable

    April 18, 2025

    Meta resumes AI coaching utilizing EU person knowledge

    April 18, 2025
    Don't Miss

    Reworking enterprise operations: 4 high-impact use circumstances with Amazon Nova

    By Oliver ChambersOctober 16, 2025

    Because the launch of Amazon Nova at AWS re:Invent 2024, now we have seen adoption…

    Your information to Day 2 of RoboBusiness 2025

    October 16, 2025

    Night Honey Chat: My Unfiltered Ideas

    October 16, 2025

    Coming AI rules have IT leaders anxious about hefty compliance fines

    October 16, 2025
    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    UK Tech Insider
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms Of Service
    • Our Authors
    © 2025 UK Tech Insider. All rights reserved by UK Tech Insider.

    Type above and press Enter to search. Press Esc to cancel.