Skip to content

Instantly share code, notes, and snippets.

@mnoble01
Last active January 30, 2018 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnoble01/b8e1f81e09bfe0784940e21065cd6e9b to your computer and use it in GitHub Desktop.
Save mnoble01/b8e1f81e09bfe0784940e21065cd6e9b to your computer and use it in GitHub Desktop.
Enhanced Workflow Technical Workshop
{
"data": {
"import_json": {
"flow_template": {
"enabled": true,
"template_name": "Product Onboarding",
"description": "Facilitate the smooth onboarding of products",
"entity_type": "product"
},
"triggers": [
{
"filter": "='salsify:created_at':relative_date(day,0)",
"name": "Product Onboarding - Product Created",
"trigger_type": "add",
"action": "initiate_flow"
},
{
"filter": "=",
"name": "Product Onboarding - Product Deleted",
"trigger_type": "remove",
"action": "close_flow"
}
],
"task_templates": [
{
"template_name": "Product Update",
"import_id": "Product Update",
"name": "{{task_configuration.configuration.task_name}} - {{entity.name | default: \"product with no name\" }}",
"description": "{{task_configuration.configuration.task_description}}",
"assignee_type": "{{task_configuration.configuration.assignee_type}}",
"assignee_id": "{{task_configuration.configuration.assignee_id}}",
"task_path": "/products/{{entity.external_id | url_escape}}",
"view_config": {
"ui": {
"$container": {
"$product_edit": {
"$bind":"task_data.product_payload"
},
"properties": "{{task_configuration.configuration.properties}}",
"required_properties": "{{task_configuration.configuration.required_properties}}"
}
}
},
"status_callbacks": {
"before_completed": [
{
"operation": "product_update",
"params": {
"id": "{{ context.entity.id }}",
"data": "{{ task_data.product_payload | as_json }}"
}
}
]
}
}
],
"task_configurations": [
{
"name": "Basic Product information",
"task_template_id": "Product Update",
"configuration": {
"task_name": "Basic Product Information",
"task_description": "Enter basic product information.",
"assignee_type": "group",
"assignee_id": "s-e3714734-1e66-4f40-91de-2114fb3dfa7f", /* Editors */
"context_key": "task_data.product_data",
"properties": [
"s-58d6f4f9-fb18-47ec-8c99-885270a4fad7", /* Category */
"s-f6421a43-7f97-4a49-bfc0-320015993340", /* Sku */
"s-88c3a8cb-f6a8-44fc-bc2f-c25c83e1307d", /* Product Name */
"s-052666d3-343a-4609-8b7e-4206959022ed", /* Description */
"s-5b97fa90-711e-48c0-954d-085cfd1495bf", /* Image */
"s-e032df33-8123-4297-9d03-9799c1063d69", /* Additional Images */
"s-b7dba669-827a-45e6-8652-931c7aaaf315" /* Tags */
],
"required_properties": [
"s-58d6f4f9-fb18-47ec-8c99-885270a4fad7", /* Category */
"s-f6421a43-7f97-4a49-bfc0-320015993340", /* Sku */
"s-88c3a8cb-f6a8-44fc-bc2f-c25c83e1307d", /* Product Name */
"s-5b97fa90-711e-48c0-954d-085cfd1495bf", /* Image */
"s-052666d3-343a-4609-8b7e-4206959022ed" /* Description */
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment