Workflow Triggers

External webhook functionalities

Overview

Shimoku introduces a powerful feature: Workflow Triggers, which seamlessly connect to External Webhooks. This functionality allows Shimoku to invoke external processes β€” akin to a workflow β€” using the "Activities" module.


Activities & Runs

  1. Activity: Think of an "Activity" as a container. It holds a webhook (an external URL that gets pinged) and the settings that dictate how that webhook behaves.

  2. Run: Each time an "Activity" is executed, a "Run" is created. This "Run" is the unique instance of that execution. It will have its settings, plus a log that keeps track of any information from the remotely executed process.


Working with Activities

Creating an Activity

s.activities.create_activity(
    name: str,
    settings: Optional[dict] = None
) -> Dict

This function sets up an activity with a specified name and settings.

Deleting an Activity

s.activities.delete_activity(
    uuid: Optional[str] = None,
    name: Optional[str] = None
)

As the name implies, this function removes a specific activity.

Updating Activity Metadata

Modify the details of an existing activity.

Fetching an Activity Object

Retrieve information on a specific activity.


Webhooks

Creating a Webhook for an Activity

Use this to add a webhook to an activity. The webhook will be the URL triggered when the activity is run.

Runs & Logs

Executing an Activity (Creates & Executes a Run)

Launch a specific activity, which subsequently triggers the associated webhook.

Fetching Logs of a Run

Retrieve the logs linked to a particular activity's run.


Note: Before working with these methods, ensure you've set the menu path using s.set_menu_path. This organizes the activities within distinct navigation paths in your app.

Last updated

Was this helpful?