This topic was automatically generated from Slack. You can find the original thread here.
We have a weird situation where a custom action is not given the steps field in the run() function’s input object.
It seems that when this custom action has a key metadata field defined, then steps is undefined when Pipedream calls this action’s run() function. If the key metadata field isn’t set (or is set to an empty string), then steps has the data about the various steps.
Here is the code:
This seems like some kind of edge case bug, since our other custom actions (as far as we have noticed) do not have this problem. Anyone know what might be going on? ?
Thanks for the detailed description and code reference. This is an unusual situation, but I can help clarify what’s happening. ## Analysis - In Pipedream custom components, the run({ steps, $ }) function should always receive the steps and $ arguments, regardless of whether the component has a key field or not. - The key metadata field is used to uniquely identify a component in the Pipedream registry. It should not affect the runtime behavior of the run() method or the arguments passed to it. - If adding a key property causes steps to be undefined in the run() function, this is not expected behavior and suggests a bug or misconfiguration. ## What could be happening? 1. Component Definition Issue: Double-check that your component is exported correctly and that the run method signature is: async run({ steps, $ }) { // ... } If you accidentally change the signature (e.g., run($)), steps will be undefined. 2. Key Collision or Misuse: If the key you set is not unique or conflicts with another component, Pipedream might behave unpredictably. Make sure your key is unique across all your components. 3. Pipedream Platform Bug: If your code is correct and the only change is the presence of a key property, this is likely a bug in Pipedream’s component loader or runtime. ## What should you do? - Double-check your component code for typos or signature mismatches. - Try changing the key value to something unique and simple (e.g., test_update_metric). See if the problem persists. - Test with a minimal component that only adds/removes the key field and logs steps to see if you can reproduce the issue in isolation. ## Example Minimal Component import { axios } from "@pipedream/platform"; export default defineComponent({ key: "test_update_metric", name: "Test Update Metric", async run({ steps, $ }) { console.log("steps:", steps); return steps; } }); - Deploy this and check if steps is defined. ## If the problem persists This is likely a bug. Please report it to the Pipedream team with your findings and a minimal reproducible example: - Pipedream — Summary: The presence of a key field should not affect the steps argument in run(). If it does, it’s likely a bug. Double-check your code, test with a minimal component, and if the issue remains, report it to Pipedream support. Let me know if you need help with a minimal reproducible example or further debugging!