alex4oA
Windmill17mo ago
1 reply
alex4o

Import tasks from files.

I am trying to make it so each file exports a task that can be imported.
export async function main(arangodb: Arangodb, databaseName: string, emailAccount: string) {
  const database = createClient(arangodb)({ databaseName })

  return getSuppliersFromArango(database)(emailAccount)
}

export const get_suppliers_from_arango = wmill.task(
  (p: { arangodb: Arangodb; databaseName: string; emailAccount: string }) =>
    main(p.arangodb, p.databaseName, p.emailAccount),
)

This way I can make flows defined in code that are fully type safe and still reside in separate files? Is that something that is/will be supported or I should think of a different strategy.
Was this page helpful?