Create a Python Integration Task
ο»ΏOne of the most powerful features in Swimlane is the ability to kick off an automation task. In this section you will create a simple Python task that you'll be able to launch via the click of a button and automatically. You will not only kick it off, but also pass a value from your record into the script, manipulate it, then pass the results back to your record.
The task you create will:
- Receive an input from a field in a record.
- Modify a variable of that field.
- Output the modified variable back to a record.
Create a Task
To create a python integration task:
- When you create a new task, you need to specify the assets the task will use. Filter for Python and locate the Python 3.6 plugin action.
- On Create a Task, click Save.You now have a Python task associated to your application.
Configure and Map Inputs to the Task
- On Configuration, enter the following Python code:
my_input_var = sw_context.inputs['text'] my_input_var = my_input_var + " is the best" sw_outputs = [{'output': my_input_var}]

Next, you set up Swimlane to grab the value of the Text (2) field when the task runs. You do this by specifying an input mapping.
- Click Save.Next, you map a value from your Python script back to a Swimlane record, also known as creating an output mapping.
Map the Outputs from the Task
- Click Add Mappings to App.
- From the Integration task bar, click Save.Next you'll set a trigger that will make the task run.
Set a Trigger for the Task
There are three ways to set triggers in Swimlane:
Trigger Type | Sub-type | Definition |
|---|---|---|
Automatic: | Scheduled | The trigger is scheduled, like a cron job. You specify how often the trigger is activated - minutely, hourly, daily, etc. This method is most commonly used when a task is collecting records from a database, slack channel, or email inbox, for example. |
ο»Ώ | The trigger is activated upon email receipt. | |
ο»Ώ | Record Save | The trigger is activated when a record is saved. |
Workflow | ο»Ώ | The trigger is activated automatically when built into the workflow stages and actions. |
Manual | ο»Ώ | The trigger is activated when the user manually pushes a button. |
For this exercise, we are creating a manual trigger.
To set a trigger for the task:
Related Links
ο»ΏConfigurations and Input MappingConfigurations and Input Mappingο»Ώ
ο»ΏOutput MappingOutput Mappingο»Ώ
ο»ΏTasksTasksο»Ώ
ο»ΏTriggersTriggersο»Ώ
ο»ΏWorkflowWorkflowο»Ώ














