WindmillWWindmill
Powered by
alex4oA
Windmill•2y 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),
)
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.
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Unauthorized Tasks?
NickReeseNNickReese / help
2y ago
How to access any Google Api (Google Tasks) from windmill ?
MathisGMMathisG / help
5mo ago
Python Import Error
SpookyBiscuit40SSpookyBiscuit40 / help
15mo ago
Cannot import pytorch
Trung DoanTTrung Doan / help
2y ago