# Run function on startup

**URL:** <https://forum.elixirforum.com/t/run-function-on-startup/30289>\
**Category:** Questions\
**Tags:** startup\
**Created:** [April 1, 2020, 3:34pm UTC](https://forum.elixirforum.com/t/run-function-on-startup/30289 "2020-04-01T15:34:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [April 1, 2020, 3:39pm UTC](https://forum.elixirforum.com/t/run-function-on-startup/30289/2 "2020-04-01T15:39:57Z")

</div>

Add one of task in your supervisor children list. You can use [`Task.child_spec/1`](https://hexdocs.pm/elixir/Task.html#child_spec/1) for that. This is what I am using for such jobs like Slack notifications or systemd notifications.

---

_[View the full topic](https://forum.elixirforum.com/t/run-function-on-startup/30289)._
