New in version 1.9.

Add self-updating capabilities to your workflow. It regularly (every day by default) fetches the latest releases from the specified GitHub repository.

Currently, only updates from GitHub releases are supported.


Alfred-Workflow will check for updates, but will neither install them nor notify the user that an update is available.

Please see Self-updating in the User Manual for information on how to enable automatic updates in your workflow.


Self-updating from GitHub.

New in version 1.9.


This module is not intended to be used directly. Automatic updates are controlled by the update_settings dict passed to Workflow objects.

class workflow.update.Version(vstr)

Bases: object

Mostly semantic versioning.

The main difference to proper semantic versioning is that this implementation doesn’t require a minor or patch version.

Version strings may also be prefixed with “v”, e.g.:

>>> v = Version('v1.1.1')
>>> v.tuple
(1, 1, 1, '')
>>> v = Version('2.0')
>>> v.tuple
(2, 0, 0, '')
>>> Version('3.1-beta').tuple
(3, 1, 0, 'beta')
>>> Version('1.0.1') > Version('0.0.1')

Implement comparison.


Implement comparison.


Implement comparison.


Implement comparison.


Implement comparison.


Implement comparison.


Return ‘code’ representation of Version.


Return semantic version string.


Match version and pre-release/build information in version strings


Version number as a tuple of major, minor, patch, pre-release.


Generate releases URL from GitHub slug.

Parameters:slug – Repo name in form username/repo
Returns:URL to the API endpoint for the repo’s releases
workflow.update.check_update(github_slug, current_version, prereleases=False)

Check whether a newer release is available on GitHub.

  • github_slugusername/repo for workflow’s GitHub repo
  • current_version (unicode) – the currently installed version of the workflow. Semantic versioning is required.
  • prereleases – Whether to include pre-releases.

True if an update is available, else False

If an update is available, its version number and download URL will be cached.


Download workflow at url to a local temporary file.

Parameters:url – URL to .alfredworkflow file in GitHub repo
Returns:path to downloaded file
workflow.update.get_valid_releases(github_slug, prereleases=False)

Return list of all valid releases.

  • github_slugusername/repo for workflow’s GitHub repo
  • prereleases – Whether to include pre-releases.

list of dicts. Each dict has the form {'version': '1.1', 'download_url': '', 'prerelease': False }

A valid release is one that contains one .alfredworkflow file.

If the GitHub version (i.e. tag) is of the form v1.1, the leading v will be stripped.


If a newer release is available, download and install it.

Returns:True if an update is installed, else False

Lazy Workflow object.