---
# System prepended metadata

title: Untitled

---

Invoke Functions Proposal

Most invoke functions follow the same pattern of try_from and then calling a workflow. I propose this trait for easy ability

```
trait Invoke
{
pub fn prepare_params<P : TryFrom<P>>(K : params)->HcResult<P>;
pub fn workflow<T>() -> HcResult<T>;
}

pub invoke_fn() -> ZomeApiResult
{
let params = P::prepare_params<Some_params>(content);
let runtime_result = T::workflow<result_value>();

}
```

-in case we need to do more mature processing for the params we can use the prepare_params
-makes sure that no step is missed when we are creating an invoke function
-Keeps everything organized(problem is refactoring)

example

GetEntry::invoke_fn()