---
title: Create a Python Integration Task
slug: user-guide-10x/create-a-python-integration-task
docTags: 
createdAt: 2025-06-18T11:01:37.466Z
---

﻿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:

1. From the global navigation menu in Swimlane select **Integrations**.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/_smkSyg4tDjdMxVxZE8wn_integration-button.png" size="14" width="263" height="65" position="center" showCaption="false"}
2. From the Integrations taskbar, click the plus menu icon, or **New Task**, and then select **Create a Task**.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/SyFOHvlktbnoatKP8-b5B_create-new-task.png" size="20" width="364" height="308" position="center" showCaption="false"}
3. 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.
4. Next, click **Create** at the end of the Python 3.6 plugin action to begin creating the task.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/tYwXFunz9LAhKWw_efzY5_new-python-task.png" size="30" width="1327" height="417" position="center" showCaption="false"}
5. Name your new task, and then associate it to your new application.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/uncltfmOKTzyJm8OzHevo_my-new-task.png" size="38" width="1133" height="424" position="center" showCaption="false"}
6. On Create a Task, click **Save**.

   You now have a Python task associated to your application.
7. The task opens with the General tab. Enter a description on this tab, if you'd like, then click Configuration.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/2tkCcp7NHxGSR-sRPphNA_python-task.png" size="28" width="785" height="629" position="center" showCaption="false"}

   In the next sub-task, you'll specify the code and the field inputs for your Python integration task.

## Configure and Map Inputs to the Task

1. 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}]

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/3vPHctmCrDi0Gm0ca6RlK_configuration-python-code.png" size="36" width="576" height="305" position="center" showCaption="false"}

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.

1. Below the Configuration window, under Inputs, click **Add Parameter,** then add the values shown here:

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/Bm-P23vHHGszEiI1g4Ail_input-variable-type-field.png" size="34" width="1385" height="189" position="center" showCaption="false"}
2. 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

1. Click the Outputs tab. For this exercise, you'll be creating output mapping to update a current record. Click **Update Current Record.**

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/C0FChA8V6o3ez8bENiXG9_update-current-record.png" size="40" width="1386" height="382" position="center" showCaption="false"}

   If you're interested in learning more about other ways to map output, see [Configure Task Output](docId\:OCwBK73t-1mQ2BIHOFC5P).
2. On the next screen, which asks you, "How would you like to proceed?" select **Map to Existing Fields.**

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/94-XrjPWXE6XtXV0Zh4cq_qs-map-to-existing-fields.png" size="36" width="695" height="545" position="center" showCaption="false"}

   Click through the next screen, which provides you with introduction to mapping.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/TiNUZ-YiCZ5r-5P-iNsOP_thebasics.png" size="30" width="520" height="375" position="center" showCaption="false"}
3. On Update Current Record for your new application, note that multiple fields have been identified as potential parameters. For this exercise, you don't need to map those parameters, but instead to create a new one.
   Place your cursor in the text field preceded by the words **Add new output mapping for ...** and type "output" then click the adjacent plus (**+**) sign.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/0_GeFRpDs6gJeFXjKXJzg_output-plus.png" size="54" width="1632" height="776" position="center" showCaption="false"}
4. The output parameter is now available above. You need to map the parameter to a field, so from the **App Field / Field Type** pull down, select Description.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/wly6SRVo1eNWTvnNcwDpx_add-mappings-to-app.png" size="50" width="1393" height="637" position="center" showCaption="false"}
5. Click **Add Mappings to App.**
6. On Approve Field Creation and Mappings, review the mapping, and then click **Approve.**

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/vWcHot7th11s409DoTUpf_approve-fields-and-mappings.png" size="46" width="1071" height="268" position="center" showCaption="false"}
7. 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. |
|                | Email       | 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:

1. Click the Triggers tab.

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/nkwy3mj2IXKx2hTcuD36z_triggers-tab.png" size="38" width="610" height="400" position="center" showCaption="false"}
2. Click the Triggers, Manual tab, then click **Open Application Builder.**

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/T0ZlLWEO4UUzXjzvLu2yM_triggers-manual.png" size="64" width="1697" height="165" position="center" showCaption="false"}

   Application Builder opens your application, where you will associate the Python task to the application.
3. Select the Integration field in the Application Form Layout, then access the App Settings.
   On App Settings, access the Task dropdown and select your Python task, then click **Save.**

   ::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/Uyf8SJD9VLmmOO84D-Oj7_app-settings-task-dropdown.png" size="40" width="1349" height="373" position="center" showCaption="false"}

   On App Settings, you can also specify the size of the Integration button in a record. The example here is 100%.
   Now you're ready to test your automation.

## Related Links

[Configurations and Input Mapping](docId\:a18JbA9DkQBGgTr8d4KJG)

[Output Mapping](docId\:OCwBK73t-1mQ2BIHOFC5P)

[Tasks](docId\:Ryxk0zN8kFYu4Nr-zKwjM)

[Triggers](docId\:Ryxk0zN8kFYu4Nr-zKwjM)

[Workflow](docId\:V7BF_Y4FXu5BA5sF2HIqy)
