slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
166 stars 28 forks source link

[FEATURE] Add support for Custom Functions w/ `file_id` parameters in Workflow Builder #338

Open pharod opened 4 months ago

pharod commented 4 months ago

I am trying to implement a custom function to be used in internal workflows by our admin teams. As input property it must accept a file uploaded by a user. I have created a workflow with 1st step being Collect info - it has a single File Upload input field.

I have defined custom function with input parameters like this:

input_parameters: { properties: { cv1: { title: "Enter a file", name: "cv1", type: Schema.types.array, description: "", items: { type: Schema.types.string, } }, }, required: ["cv1"], },

I am able to bind this input property to a File Upload field, but than I am instantly see the error from WF Builder:

Screenshot 2024-07-08 at 11 15 02

I have also tried to use Schema.slack.types.file_id but in that case I am unable to even bind this property to File Upload field in WF Builder - it shows another error saying that this type is not yet supported by WF Builder.

Screenshot 2024-07-08 at 11 39 51
filmaj commented 4 months ago

I think the actual problem here is that OpenForm doesn't seem to accept file_id types, yes? In my local testing that seems to be the case... EDIT: nevermind that was my mistake. OpenForm support for file_id works fine.

filmaj commented 4 months ago

This seems to be a limitation in Workflow Builder w/ wider support of the file_id type, such as when they are parameters in a custom step. Will report this internally, but I also suggest you email feedback@slack.com and let the support team know that this is a feature gap that you would like to see filled.

pharod commented 4 months ago

Thank you for detailed explanation! We've already gave up on workflows and re-implemented as regular slack app.