This topic was automatically generated from Slack. You can find the original thread here.
It appears that File Store feature is NOT accessible within My Actions component. $.files is not accessible due to security I assume, there’s NO way to pass that to the component as a prop, so file store is completely inaccessible.
It appears that File Store feature is NOT accessible within My Actions component. $.files is not accessible due to security I assume, there’s NO way to pass that to the component as a prop, so file store is completely inaccessible.
It appears that you’re encountering issues accessing the File Store within your custom action component. The $.files helper is indeed scoped to workflows and is not directly accessible within custom action components due to security constraints. To work around this limitation, you can use the following approach: 1. Use a Workflow to Access the File Store: Create a workflow that accesses the File Store and performs the necessary operations (e.g., reading, writing, or deleting files). 2. Trigger the Workflow from Your Action Component: Use an HTTP trigger or another method to call this workflow from your custom action component. Here’s an example of how you can set this up: ### Step 1: Create a Workflow to Access the File Store Create a new workflow with an HTTP trigger and a code step to access the File Store. For example, to read a file: import { axios } from "@pipedream/platform"; export default defineComponent({ async run({ steps, $ }) { // Open the file by its path in the File Store const file = $.files.open('example.png'); // Log the S3 URL to access the file publicly const fileUrl = await file.toUrl(); return { fileUrl }; }, }); ### Step 2: Trigger the Workflow from Your Action Component In your custom action component, make an HTTP request to trigger the workflow created in Step 1: ```
import { axios } from “@pipedream/platform”; export default defineComponent({ props: { workflowUrl: { type: “string”, label: “Workflow URL”, description: “The URL of the workflow to trigger”, }, }, async run({ steps, $ }) { // Trigger the workflow and get the file URL const response = await axios($, { method: “POST”, url: this.workflowUrl, }); return response; }, });
Thank you, is there no way to turn this into a feature request. It appears to be a hacky work around, considering this is My Components, not a 3rd party thing, shouldn’t my components have access to the Filestore?
I ran into the same issue. I am trying to split our code into reusable actions. Whilst refactoring a componen using the file store into an action, it stopped working.
The execution scope of the action is the exact same, nothing else changed. Can we please get this fixed or a reasonable workaround provided?