Want a really lovely human to build your first workflow with you?

OpenFn logo

Singapore's 'FormSG' Adaptor on OpenFn: A Digital Public Good Success Story

a woman with a nose ring is smiling in front of a bush .
Michel Fang from Open Government Products
Alwyn Tan from Open Government Products

Justine Stewart, Michel Fang and Alwyn Tan

5 min read
Share

Recently, we were pleased to hear from Michel Fang from Open Government Products in Singapore. "Quick update: I've built a FormSG adaptor for OpenFn". Great! We thought…this community contribution is the perfect demonstration of how Digital Public Goods (DPGs) are meant to work. This is the story of how one collaborator from the OpenFn ecosystem contributed to the Digital Public Good to make integration easier for the whole ecosystem.

The partnership started when Cheryl Lee, Head of International Tech Strategy, reached out to discuss how FormSG and OpenFn could work together.Their development team had identified a gap, built the solution, and contributed it back to the open source product. It's exactly the kind of collaboration that makes DPGs valuable: when organizations don't just use the tools, but actively improve them for everyone.

What is FormSG?

FormSG is Singapore's government digital form builder, designed with end-to-end encryption to protect citizen data. The platform includes webhook functionality, allowing form submissions to trigger actions in external systems. Until now however, there wasn't a straightforward way to decrypt those submissions and route them into automated workflows using OpenFn.

Building the Solution

We asked Alwyn Tan and Michel Fang from Open Goverment Products some questions about the adaptor and the process.

OpenFn: Can you explain, in simple terms, what this Adaptor does? What key functionalities does the Adaptor allow an OpenFn workflow to perform?

Alwyn and Michel: The adaptor allows an OpenFn workflow to process submissions from FormSG. FormSG submissions are encrypted end-to-end; in exchange for ensuring that citizen data is kept safe, more work is needed to unpack the submission before handling its contents. This adaptor does most of that work, allowing OpenFn users to focus on their workflow.

OpenFn: How was your experience building the Adaptor? Talk us through the process from conception to release (and how you used AI!).

Alwyn and Michel: Building the FormSG adaptor was a great experience overall. The open source OpenFn adaptors repository was very easy to get started with. It’s well documented and simple to self-onboard, which made contributing straightforward.

I chose to write the adaptor in TypeScript, although JavaScript would have worked just as well. The development process was smooth and enjoyable, and the OpenFn team’s review was both timely and thoughtful.

I used AI lightly, mainly for small refactoring and writing tests, but it definitely helped streamline parts of the process.

Michel's solution wraps the @opengovsg/formsg-sdk to provide two core functions:

  1. decrypt encrypted form submissions
  2. optionally, verify the submission signature, ensuring that the submission came from FormSG

Built entirely in TypeScript with comprehensive testing, the adaptor maintains OpenFn's state pattern and includes clear documentation for implementers.

The integration flow is straightforward: configure your FormSG form with OpenFn's webhook URL, and when someone submits the form, the encrypted payload is automatically sent to OpenFn, decrypted, and made available for routing to any downstream system as part of an OpenFn workflow. That could include anonymisation and analysis by LLMs, and/or populating reporting dashboards, and/or creating tickets for case management.

OpenFn: What does it mean for your organization to contribute to a Digital Public Good?

Alwyn and Michel: FormSG is a derivative of an earlier open-source form builder. Given that Singapore has benefited significantly from this open-source codebase, and the time and resources invested into building FormSG, Open Government Products decided to publish FormSG as open-source software, so that other organisations may avoid duplicating effort and take advantage of the work that has already been done.

It takes effort to build integrations with FormSG however, so to make adoption of FormSG even more straightforward, we decided to provide an OpenFn adaptor to allow FormSG to be more easily integrated with other systems around the world via OpenFn.

Why This Matters: The DPG Collaboration Model in Action

When organizations use proprietary software, they're limited to whatever features the vendor chooses to build. Digital Public Goods work differently. When Michel and the FormSG team identified a need, they built the solution and contributed it back. Now every organization using both FormSG and OpenFn can benefit from this work.

This is the fundamental value proposition of DPGs: investment in the platform compounds across all users. One team's contribution becomes infrastructure for countless others. The next government agency, NGO, or development organization that needs to automate encrypted form processing doesn't need to start from scratch.

Real-World Applications

With the FormSG adaptor, organizations can now build workflows connecting secure form submissions to:

  • Case management systems for citizen service requests
  • Eligibility processing and approvals for benefits applications
  • Analytics platforms for feedback collection
  • CRM systems and payment platforms for program enrollment

The adaptor works with OpenFn's 80+ other adaptors and can connect to any system with an API, meaning FormSG data can flow into DHIS2, Salesforce, mobile money providers like MTN and MPesa, plus WhatsApp and many, many more.

Get Started

Ready to automate workflows with FormSG and OpenFn? Or create your own?

a woman with a nose ring is smiling in front of a bush .
Michel Fang from Open Government Products
Alwyn Tan from Open Government Products

Written by

Justine Stewart, Michel Fang and Alwyn Tan

Save time & scale your impact with OpenFn. Get started today!