View markdown source on GitHub

Galaxy Webhooks

Contributors

Questions

Objectives

last_modification Last modification: Jul 9, 2021

What are Galaxy Webhooks?

A system which can be used to attach new functionalities to predefined entry points in the Galaxy interface.

An accessible way to make isolated customisations to a Galaxy instance.


Entry point: masthead

A person shaped icon in the Galaxy masthead is being hovered over and the popup reads "Show Username", presumably a custom webhook from a tutorial.

Adds item to the top menu.


Entry point: tool/workflow submission

Screenshot of Galaxy with the job completion screen shown and a PhD comic image shown below.

Shown after tool or workflow execution.


Entry point: tool-menu

Adds an entry to the tool form menu.


Entry point: history-menu

A section of the history menu is labelled Webhooks and shows a custom menu entry.

Adds an entry to the history menu.


What is a webhook made of?


Example configuration YAML

<span id="trans_object
type:"><i class="fas fa-link" aria-hidden="true"></i> trans_object
type:
</span>
  - masthead
activate: true

icon: fa-user
tooltip: Show Username

function: >
  $.getJSON("/api/webhooks/trans_object/get_data", function(data) {
    alert('Username: ' + data.username);
  });

Definition of the configuration options

Argument Description
name Name of the Webhook (and API call)
type Entry point. tool/workflow/masthead/history-menu. More might be available in future
activate (De-)Activates the Webhook. true/false
icon Icon to show for a masthead plugin. Full list of available icons here
tooltip Tooltip to show for masthead plugins
function JavaScript code to run when masthead button is clicked

Example __init__.py

def main(trans, webhook):
    if trans.user:
        user = trans.user.username
    else:
        user = 'No user is logged in.'
    return {'username': user}

The return value can be read with a call to /api/webhooks/WEBHOOK_NAME/get_data

Want to integrate Webhooks in your Galaxy instance?


Want to contribute?


Developing the Webhooks implementation


Key Points

Thank you!

This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors! Galaxy Training Network This material is licensed under the Creative Commons Attribution 4.0 International License.