Error running a shortcut through an Action

I’m using this Shortcut to upload multiple photos to Micro.blog, generate alt text, and copy the list of Markdown URLs to paste in Drafts. Works fantastic when I use it as a shortcut. I tried calling it from a Drafts Action - run shortcut & copy result to the Drafts note I’m working in - and it gives me an error from the OpenAI part of the shortcut.

{"error":{"param":null,"message":"You uploaded an unsupported image. Please make sure your image is below 20 MB in size and is of one the following formats: ['png', 'jpeg', 'gif', 'webp'].","code":"invalid_image_format","type":"invalid_request_error"}}

It doesn’t show me the media selection pop-up so no image is sent to OpenAI. I may be missing something basic.

The shortcut is set to receive images as input. Presumably you are calling it from Drafts with text input and that is why it is complaining that you are passing it something that is not an image.

You haven’t shared your setup for calling the Shortcut from Drafts (just a note on using run shortcut) so this is just a bit of an educated guess on what is going on.

Heya! I made that shortcut. It’s supposed to fallback to asking for an image if there’s no input passed to the shortcut. If this box is empty in the action’s setup, there shouldn’t be any input passed to the shortcut, right?

This is how I do it though:

This action…

…calls a helper shortcut…

…which then kicks off the actual one that gets/uploads images (and calls another shortcut to get the alt text).

In the end, it all gets passed back to Drafts.

Jarrod is referring to an Action that references another of his amazing shortcuts which doesn’t work in an inexplicable way for me (works for him tho). That’s a separate one I’m trying to troubleshoot but this is a different one (that does a similar thing).

I guess I’ve to start at the basics. How do you call a shortcut from an Action especially the one that has a selection menu up at top? I am using Run Shortcut with “Photos” as the input and then [[shortcut_result]] with the Insert Text step.

Can you share your action?

I still strongly suspect, as I noted in my reply above, that you have an input in a Run Shortcut step that should most likely be empty/blank - after all, you have no images in Drafts to pass to the shortcut, and if you pass something to a shortcut that expects an image that is not an image you will get exectly the sort of error you presented.

Thanks. @_heyjarrod was able to help me offline to modify his other Drafts action that did something similar. I guess I have to read up more on how to incorporate Shortcuts within Actions.