Template Flows: From Idea to Impact

amishabisht

NOVEMBER 26, 2024

Share

Creating chatbot flows can be a daunting task, especially for NGO staff who are new to Glific or just starting with chatbot automation. We noticed that building flows from scratch often takes significant time and effort. For new NGOs, it can take even longer as they learn the ropes of flow creation. This process also misses an opportunity to leverage the collective knowledge and best practices already established by the community.

As a result, NGOs sometimes end up with flows that have bugs, miss edge cases, or are inefficient—ultimately leading to frustration and a steeper learning curve.

That’s where Template Flows come in to save the day!—a feature designed to make flow creation faster, easier, and more effective. This addition allows NGOs to access pre-built, community-tested flows that cover common use cases. Instead of starting from scratch every time, staff can now use these templates as a foundation, saving time and effort while ensuring they follow best practices.

Design of Template Flows in Glific

We introduced Template Flows to make flow creation faster and easier for NGO staff. Here’s how the feature works:

  1. New Dropdown: We added a “Template” option in the flow section dropdown, separate from “Active” and “Inactive” flows, to keep things organized.
  2. Create Flow Options: When clicking “Create,” staff can choose between:
    • Create from Scratch (as usual)
    • Create from Template (shows a list of pre-built templates for different use cases).
  1. Flow Buttons:
    • View It: Opens a detailed, read-only view of the template, including description and limitations and can run the flow on simulator
      Use It: Clicking this creates a copy of the template. Staff can customize it (name, keywords, description) and publish it.
  1. Post-Publish: The new flow appears in Active flows, but the original template remains unchanged.
  2. Easy Access: Staff can also access the Template Flows list directly from the Flow list page.

The Journey of Template Flows

When we first released the Template Flows feature during our accelerator program with new NGOs (those were not a part of the Glific community), it turned out to be a real lifesaver! It was definitely a feature worth adding.

So here’s how it all went down:

The day our team proposed this idea, we had some back-and-forth discussions, and after ironing out the details, the team started building. From a developer’s point of view, it wasn’t a huge feature to implement because Glific’s code is pretty flexible. We were able to reuse most of the existing code to bring Template Flows to life.

However, when we released the feature, it quickly became clear that it was one of the buggiest ones we’d launched. There were a few reasons for that:

  1. Initially, we didn’t think the feature would be that complex, especially since we were just using existing APIs.
  2. The time constraint, with the need to deliver it before the accelerator program, pushed us to rush things.
  3. Most importantly, we didn’t have enough discussion or testing before the release.

But, we went back to the drawing board, fixed the issues, and implemented the feature according to our original design.
One issue we faced was with flow names and keywords. Keywords were assigned to template flows so NGOs could test them in the simulator. However, since these flows weren’t directly accessible, NGOs couldn’t delete or edit them. This became a problem when a beneficiary accidentally used a reserved keyword, triggering the linked flow automatically

To resolve this, we updated the design. We decided that template flows wouldn’t have specific keywords anymore.

Initially, we considered a solution where the template flow wouldn’t be triggered by a keyword. Instead, the front end would call the start_flow API directly for the simulator. This would avoid keyword conflicts between NGO-specific flows and template flows. But the problem with that approach was that it required the simulator to be in the session window, or else it wouldn’t work. To get it to function, users would have to send a message to the simulator first before testing the flow.

Clearly, that wasn’t the smooth, seamless experience we were hoping for. It was like asking someone to take a detour just to get to their destination!

After some more brainstorming, we came up with a better solution:

We decided to add a template prefix to the flow name (like template:welcome_flow) and trigger the flow in the simulator without relying on keywords, and it worked!

Learning for Future

  1. We Underestimated the Work
    • At first, we thought it would be simple and wouldn’t need much effort. Turns out, we were wrong, and the rushed delivery led to bugs. Lesson learned: don’t take simplicity for granted—plan better!
  2. Testing Wasn’t Enough
    • We didn’t test thoroughly because of time constraints, and it showed. The feature was buggy when released. Next time, we’ll ensure proper testing, even under deadlines.
  3. Think Like the User
    • Some design choices, like using keywords for testing, caused problems for NGOs. They couldn’t edit or delete flows, leading to confusion. Now we know: always consider how users will interact with a feature.
  4. Iterate and Adapt
    • We fixed bugs and adjusted the design as we went along. It wasn’t perfect from the start, but refining the solution step by step got us there.

 And just like that, after a few more tweaks and tests, Template Flows were live and working as expected! Well, until we find another bug, of course—because that’s the nature of development, right? But it was a nice proud moment for the team. We had learned a lot, fixed the issues, and were excited to see how much easier this feature would make flow creation for NGOs. It’s all part of the journey—testing, learning, improving, and delivering something that truly helps our users.

One response to “Template Flows: From Idea to Impact”

  1. Glific says:

    […] we could have planned and tested the feature more thoroughly before the release. Here is a Blog on our learnings & […]

Leave a Reply

Tags

#Glific

Discover more from Glific

Subscribe now to keep reading and get access to the full archive.

Continue reading