My favorite tool for finding software alternatives is alternativeto.net, which returns these alternatives for Zapier: https://alternativeto.net/software/zapier/
Most promising on that list is Huginn (https://github.com/huginn/huginn) which looks like exactly what you want.