Workflow Functions return typings

I can use JSDoc to declare typings within a single code block, but it would be great to get the typings from functions too. Right now all functions are typed as objects, so I don’t get any help from the editor when trying to call them, or calling them incorrectly.

Thanks!

Hi @matt-arena,

Can you give me more details on how you are declaring typing inside of a workflow code block?

Also how are you thinking you'd want to call a workflow function?

Are you looking for type support for the argument data types that a workflow function is expecting to receive to call it correctly with data from previous blocks?

This is mainly thinking about reusable functions so that I can share complex functionality across multiple workflows or code blocks without needing to create npm packages. What I'd like is probably something like Retool RPC, but writing the code directly into the function query rather than connecting a server.

Mainly I've tried JSDoc comments, but writing typescript would be awesome (obviously more difficult for feature parity with python). I would want those functions to be available to my code blocks throughout the workflow, and I'd want to call them the same way I'd call any globally available method. They way it works now is fine with me (await funcName(...)).

I'd love parameter typing too, but can work around that with JSON serialization.

Ah I see, thank you for the clarifying details @matt-arena!

Have you tried using Workflow Functions? Let me know if that feature has any limitations for your use case and I can make a feature request on that :+1: