How Can I Determine If a Pipedream Action Failed?

This topic was automatically generated from Slack. You can find the original thread here.

Is there any way to know if a pipedream action failed? One idea is to look at the os return and see if anything that mentions “error” in there. But it seems like that field is not always populated and that it is an “any” type, so unclear to me if it can be relied upon.

worker-1    | pipedream action response {
worker-1    |   "os": [
worker-1    |     {
worker-1    |       "ts": 1762820728432,
worker-1    |       "k": "error",
worker-1    |       "err": {
worker-1    |         "name": "Error",
worker-1    |         "message": "Missing time zone definition for start time.",
worker-1    |         "stack": "Error: Missing time zone definition for start time.\n    at makeErrorObservation (/var/task/node_modules/@lambda-v2/component-runtime/src/makeErrorObservation.js:7:11)\n    at captureObservations (/var/task/node_modules/@lambda-v2/component-runtime/src/captureObservations.js:30:24)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async run (file:///var/task/component_maker.mjs:157:20)\n    at async file:///var/task/component_maker.mjs:199:11"
worker-1    |       }
worker-1    |     }
worker-1    |   ],
worker-1    |   "exports": {},
worker-1    |   "t": {
worker-1    |     "ar": 1762820717074,
worker-1    |     "br": 1762820717178,
worker-1    |     "bp": 1762820717178,
worker-1    |     "bls": 1762820717178,
worker-1    |     "ble": 1762820728443
worker-1    |   }
worker-1    | }

For example, I’m getting this back, despite the overall pipedream sdk not throwing an error

    const response = await this.pipedreamClient.actions.run(requestBody);

e.g. calling this

I would expect this to return a 400 basically or something

Yea, the nuance is that that call didn’t fail in Pipedream, it failed in the upstream API. We will only 4**** on you in the case of a bad payload, etc.

I believe os.k == error is correct for looking for errors from failed action executions.

Got it - is there a guarantee that os will always be an array returned? trying to think of best way to parse it - it’s typed as “any” in the api docs and “unknown” in the SDK

I believe so, yes.