Comment on page
Scheduling your Automation
Create fully automated processes by scheduling your Python script to run on GitHub
After you've used Mito to write Python code, you may want to schedule this code to execute on a repeated basis. Mito makes it incredibly easy to schedule a Python automation, automatically handling:
- 1.Automatic version control/documentation: Mito will place your automation and initial data files under version control, making sure that you never loose your work. Moreover, auto-generated documentation means your team can easily understand your automations.
- 2.Avoid breaking dependency updates: Mito will automatically detect what dependencies you're using, and freeze them for your automation. This makes sure future package changes don't break your code without your knowledge!
- 3.Avoid complex scheduling interfaces: Visually tell Mito the cadence to run your automation and let Mito handle generating cron job syntax, timezones, ensuring runners are available, and making sure all you need to do is download the result.
Currently, Mito supports Github Actions as it's primary automation location. Mito will automatically open automation PRs against your selected repository.
os.environ['MITO_CONFIG_GITHUB_AUTOMATION_REPO'] = 'mito-ds/mito-automations-test'
- 2.Set the Github Token as an environmental variable wherever you are running Mito.
os.environ["GITHUB_TOKEN"] = "ghp_thisisarandomstringoflettersandnumbers"
Code > Schedule Automation
- 2.Give the automation a descriptive
Automation Description. The Automation Name will become the GitHub PR title and the Automation Description will be the PR description.
- 3.Configure the
Schedule on Github. Mito will create a new PR with the required input files, Python code, and GitHub action workflow. In a few moments the PR will be ready for review.
Use Mito to schedule automations on GitHub
- 1.Review the code of this PR, making any necessary changes or updates
- 2.Merge this PR into the main branch to schedule the automation.
- 1.Go to the Github repo configured in Step 1.
- 2.Go to the
Actionstab and select the action for this automation.
- 3.Click on the most recent run for this automation.
- 4.Scroll down, and download the
resultsartifact. This will contain the results of the automation. If there is no
resultsartifact, this is likely because you did not export any files in your generated code.