You can certainly have a background thread that runs on your Datomic node(s) and handles async processing.
The main point I should make here is that your process should be coordinated via ion calls, but you should not make individual ion calls that are long-lived (i.e. don’t make run-my-whole-import-job
a lambda-invoked ion).