I have been doing some deep thinking about how to design an integration which pulls new records from one app and references them to create records in another app.
I have been reading Pipedream docs all day yesterday and it seems I have two design goals which aren’t easily accomplished using the provided Pipedream tools, but maybe I’m lacking knowledge and someone here can help me.
I want to ensure my workflow processes each record exactly once. My first idea was to use a scheduled workflow to issue an HTTP query which retrieves the latest records from the source app.
While I was thinking this may work if I handle all the edge-cases, I discovered that the Event Source component has special support for ensuring only-once delivery of an event to a workflow which uses it, using a “dedupe strategy” and event ids.
If I use an event source, it means the semantics of my workflow would be “operate on one record”, rather than “once per hour query a batch of records”, which are two wildly different things.
While the former seems fine, it conflicts with a nice-to-have goal of mine which is reducing API usage. In my current case, I want to create records in Salesforce, and Salesforce provides a REST resource named “composite” which enables me to send several REST requests in a single HTTP request. Salesforce will process each REST request in that bundle, then respond with an array of statuses for each sub-request. A primary reason I like using fewer HTTP requests is due to some feelings I have (source unknown) that an HTTP request has some overhead, perhaps because of the a server’s costs in having an HTTP request open, or perhaps I’ve seen an API which limits number of requests per hour, or perhaps I’ve seen some API integration tools which bill you based on the number of requests you make per month.
If I wanted to reduce HTTP requests I send, I would want to consider creating an Event Source which emits batches of events, allowing workflows using that source to reduce the batch to produce a set of REST requests, then batch those REST requests into a few HTTP requests to send to the “composite” resource.
I don’t recall seeing a philosophy of API integration design in the docs which might answer this question, but does Pipedream have an opinion this matter? I feel like it must, and I feel like it could easily convince me that in Pipedream-world it’s more efficient for workflow-builder and for Pipedream the platform to build workflows which have semantics of “operate on one record”.