Close
    logoCloudomation Docs

    Plugins

    Plugins extend the functionality of Cloudomation.

    Use Cases

    Use a plugin to

    • bundle various Cloudomation resources so they can be transported between Cloudomation workspaces.
    • load bundled Cloudomation resources into your workspace.
    • extend the Cloudomaton User Interface with action buttons which create executions when clicked.

    Concept

    pluginsPluginPluginResourcesResourcesPlugin->ResourcescontainsActionsActionsPlugin->ActionsprovidesExecutionsExecutionsActions->Executionscreate

    All Cloudomation resources can be associated with a plugin. When exporting a plugin all associated resources will be included in the resulting YAML file. This YAML file can then be transported to other workspaces to import all resources at once.

    Plugin actions are restricted to a resource type. For each plugin action an action button will appear when viewing resources of the specified type. Clicking on a plugin action button will start an execution of the referenced flow and pass the ID of the resource in the input_value.

    Plugins can contain only resources, or only actions, or both.
    We recomment to design self-contained plugins. A plugin should contain all resources (flows, settings, actions, etc.) which are needed for its purpose. If a plugin has dependencies, it should always check if they exist and provide meaningful errors when they are missing.

    Configuration

    Please see the table below for the different plugin fields and their meanings:

    FieldDescription
    VersionA version number of the plugin.
    EnabledIf unset, Cloudomation will not create action buttons of the plugin actions.

    Please see the table below for the different plugin_action fields and their meanings:

    FieldDescription
    Parent actionWhen set, this action will be placed in a dropdown menu below the parent action.
    Resource typeA Cloudomation resource type where the action should create a button.
    Field nameThe name of a field of the resource type where the button should appear. Currently not used.
    ColorThe color of the button. Currently not used.
    IconAn icon to display on the button.
    EnabledIf unset, the action does not create a button.
    FlowThe flow which should be started when the button is clicked.
    TypeOne of LIST, RECORD, or FIELD. See Action types.

    Action Types

    • LIST

      The action button is also shown in list views. When clicked the flow is started once and the execution gets all record IDs passed in the input_value.

    • RECORD

      The action button is shown in the record header. When clicked the flow is started once for each record and each execution gets one record ID passed in the input_value.

    • FIELD

      Currently not implemented

    Export

    The User Interface provides an "Export" button. When clicked, the browser will download the plugin YAML.

    Example

    Export a plugin from the command line

    $ curl https://jollyroger.cloudomation.com/api/latest/my-plugin\?by=name\&download=export
    plugin:
    name: my-plugin
    version: 1
    ...

    Import

    The User Interface currently does not provide a way to import plugins.

    Example

    Importing a plugin from the command line

    $ curl -X POST https://jollyroger.cloudomation.com/api/latest/import -d @my-plugin.yaml

    Action Handler Flow

    The flow which is registered in a plugin action will be used to create an execution when the action button is pressed.

    Example

    Flow to handle a "LIST" plugin action

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    inputs = this.get('input_value')
    # Type "LIST" actions pass "ids"
    ids = inputs['ids']
    # we iterate over the list of IDs
    for id_ in ids:
    # read the type of the resource and the name
    this.log(system.resource(id, by='id').get('resource_type', 'name'))
    return this.success('all done')
    Example

    Flow to handle a "RECORD" plugin action

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    inputs = this.get('input_value')
    # Type "RECORD" actions pass "id"
    id_ = inputs['id']
    this.log(f'I was called with the ID {id_}')
    return this.success('all done')
    Example

    Flow to handle a "FIELD" plugin action

    #TBD

    Learn more

    Connection Resource
    Git Integration
    Messages and Forms
    Knowledge Base — Previous
    Messages and Forms
    Next — Knowledge Base
    Savepoints