- Events are delivered to the Destinations asynchronously, after your workflow completes. This means you don’t wait for network I/O (e.g. for HTTP requests or connection overhead for data warehouses) within your workflow code, so you can process more events faster.
- In the case of data stores like S3, you typically don’t want to send every event on its own. This can be costly and carries little benefit. Instead, you typically want to batch a collection of events together, sending the batch at some frequency. Destinations handle that batching for relevant services.
Available Destinations
Using destinations
Using destinations in workflows
You can send data to Destinations in Node.js code steps, too, using$.send
functions.
$.send
is an object provided by Pipedream that exposes destination-specific functions like $.send.http()
, $.send.s3()
, and more. This allows you to send data to destinations programmatically, if you need more control than the default actions provide.
Let’s use $.send.http()
to send an HTTP POST request like we did in the Action example above. Add a new action, then search for “Run custom code”:
Create a new HTTP endpoint URL (try creating a new Pipedream workflow and adding an HTTP trigger), and add the code below to your code step, with the URL you created:
$.send.http()
function.
Again, it’s important to remember that Destination delivery is asynchronous. If you iterate over an array of values and send an HTTP request for each:
await
the execution of the HTTP requests in your workflow. We’ll collect every $.send.http()
call and defer those HTTP requests, sending them after your workflow finishes.
Using destinations in actions
If you’re authoring a component action, you can deliver data to destinations, too.$.send
isn’t directly available to actions like it is for workflow code steps. Instead, you use $.send
to access the destination-specific functions: