This topic was automatically generated from Slack. You can find the original thread here.
My workflow generates 1 event per day at 2am. I would like to consume this event in third-party code running on cron at 4am while avoiding any state or receiving incoming requests on the cron side. What are my options?
My workflow generates 1 event per day at 2am. I would like to consume this event in third-party code running on cron at 4am while avoiding any state or receiving incoming requests on the cron side. What are my options?
To achieve your goal of consuming a Pipedream event in third-party code running on a cron schedule without maintaining state or receiving incoming requests, you can use Pipedream’s event sources and REST API. Here’s a step-by-step approach: 1. Emit Events from Pipedream Workflow: Ensure your Pipedream workflow emits events at 2am as you described. 2. Use Pipedream REST API: You can retrieve the emitted events using Pipedream’s REST API. This allows your third-party code to pull the events when it runs at 4am. 3. Setup Your Cron Job: In your third-party environment, set up a cron job to run at 4am. This job will make an HTTP request to Pipedream’s REST API to fetch the events. 4. Process the Events: Once your cron job retrieves the events, you can process them as needed in your third-party code. Here’s a simple example of how you might structure the HTTP request in your cron job using a tool like curl or a programming language of your choice: bash curl -X GET "https://api.pipedream.com/v1/events" \ -H "Authorization: Bearer YOUR_API_KEY" Replace YOUR_API_KEY with your actual Pipedream API key. This request will fetch the events emitted by your workflow. For more details on using the Pipedream REST API, you can refer to the Pipedream API documentation. If you have any further questions or need clarification, feel free to ask!
I can use state on the pipedream side, just not on the Lambda side. So you suggest putting events to a Data Store and then adding an HTTP-triggered workflow? How can I return data over HTTP from the workflow?
You can configure the trigger to return a custom response from the workflow. And then at some point in the workflow, you need to add a HTTP response action