Fetch additional data as a workflow step
Today we're shipping a new function step to the Knock workflow builder: the fetch function. With the fetch function, you can build and execute HTTP requests to any external service as a step in your workflows. Knock will merge any data returned to a fetch step request into the global state for the workflow run, thus making it accessible to all templates in subsequent workflow steps!
You can use fetch functions to grab data for a workflow run that may not be readily available at the time you trigger a workflow, such as for workflows that use batching to create large activity groups. You can even use fetch functions to trigger side effects in your external systems as Knock processes a workflow run.
Our goal is to ensure Knock serves as many possible notification use-cases with a dead-simple interface. The fetch function adds even more flexibility to Knock and unlocks some neat ways to compose workflows.
Check out the new guide on fetch functions or head to the workflow editor now to get started with fetch functions in your workflows.
Trigger conditions for all
Trigger conditions, previously only available for channel steps, are now available for use in all workflow steps. As part of this expansion, we've also added a brand new guide on trigger conditions to the Knock docs.
Trigger conditions allow you to specify if a given step will execute at workflow execution time. They are one of the many ways you can build powerful logical notification flows with Knock.
With this update trigger conditions are now even more powerful and easier to use.
Performance tuning for our API logs
We've seen recently that it could take a long time (several seconds for our largest customers) to load the list of API logs in Knock. So we invested some time to dig in and address the issue. We found that both the structure of the query used to load the logs and the primary database index used to filter the query had a number of optimization opportunities.
After implementing the necessary changes, we've observed a substantial decrease in query time. For our largest customers, we've seen average query execution times decrease from from 12 seconds to 15 milliseconds!
Our API logs are an important part of the developer experience within Knock, and with this release we're ensuring that they feel performant at any scale.
Fixes and improvements
- 🌱 We've added a UI for channel preferences to the user and object preferences tabs, including the ability to toggle a channel on/off from the Knock admin.