Workflow rule with field update function

Workflow rule with field update function

Hi,

I need to be able to create my custom module record name before it's inserted as it will work like a composite key made up from 3 different fields.

I created a simple function that concatenates these fields but I can't choose it to be selected in the workflow. It's simple code of 

return <arg1> + "-" + <arg2> + "-" + <arg3>;

if I select to write my own function again in the workflow it only allows me to create function with no return (void).

If I select field update as an action it only allows me to update it with static value.

How can I use my function to pass a value to the workflow before/on creation of a record?