Is There a Way to Get a File's Name from Its Descriptor in Workflow Passes?

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

If I’m using a file descriptor to pass a file reference between workflows, is there (or should there be) a way to get the file’s name? The file descriptor object itself has a path property, but this is not documented anywhere.

How are you passing the file descriptor to another workflow? Are you using Data Stores or File Stores?

It’s a File Store descriptor. I’m passing it as an emitted event value. (I didn’t know Data Stores had file descriptors…)

I figured I shouldn’t read the descriptor object directly since it’s undocumented (and thus more likely to change), so I’m passing the filename as another value. But it might make sense for the File object to have a documented method or property to return its name.

Yeah, makes sense. I think passing the filename is a more natural way of handling with files

Interesting. The API documents $.files.openDescriptor() but it isn’t clear when this needs to be used if descriptors are “automatically parsed back into a File instance” when passed into another step. Maybe this only takes place under certain conditions, or openDescriptor should be private?

I’m actually using openDescriptor now from my other workflow because I didn’t realize or try the automatic behavior, so I’m not sure if it works in that scenario. Anyway, looking forward to this feature getting some more robust documentation