# Add poster and preview images to video uploads [View original](https://ittybit.com/guides/add-poster-preview-images) ## Workflow ```json [ { "kind": "conditions", "conditions": [ { "prop": "kind", "value": "video" } ], "next": [ { "kind": "image", "ref": "poster", "width": 1280, "format": "jpeg" }, { "kind": "image", "ref": "preview", "width": 320, "format": "jpeg" } ] } ] ``` *** ## Create Task ```ts const task = await ittybit.tasks.create({ url: "https://ittyb.it/sample.mp4", kind: "workflow", workflow: [ { kind: "conditions", conditions: [ { prop: "kind", value: "video" } ], next: [ { kind: "image", ref: "poster", width: 1280, format: "jpeg" }, { kind: "image", ref: "preview", width: 320, format: "jpeg" } ] } ] }) ``` ```python task = ittybit.tasks.create({ url="https://ittyb.it/sample.mp4", kind="workflow", workflow=[ { kind="conditions", conditions: [ { prop: "kind", value: "video" } ], next: [ { kind: "image", ref: "poster", width: 1280, format: "jpeg" }, { kind: "image", ref: "preview", width: 320, format: "jpeg" } ] } ] }) ``` ```ruby task = ittybit.tasks.create({ url: "https://ittyb.it/sample.mp4", kind: "workflow", workflow: [ { kind: "conditions", conditions: [ { prop: "kind", value: "video" } ], next: [ { kind: "image", ref: "poster", width: 1280, format: "jpeg" }, { kind: "image", ref: "preview", width: 320, format: "jpeg" } ] } ] }) ``` ```php $task = $ittybit->tasks->create([ 'url' => "https://ittyb.it/sample.mp4", 'kind' => "workflow", 'workflow' => [ 'kind' => "conditions", 'conditions' => [ { 'prop' => "kind", 'value' => "video" } ], 'next' => [ { 'kind' => "image", 'ref' => "poster", 'width' => 1280, 'format' => "jpeg" }, { 'kind' => "image", 'ref' => "preview", 'width' => 320, 'format' => "jpeg" } ] ] ]); ``` ```go task, err := ittybit.Tasks.Create( context.TODO(), &ittybit.TaskCreateParams{ Kind: "workflow", URL: "https://ittyb.it/sample.mp4", Workflow: []ittybit.Task{ { Kind: "conditions", Conditions: []ittybit.Condition{ { Prop: "kind", Value: "video" } }, Next: []ittybit.Task{ { Kind: "image", Ref: "poster", Width: 1280, Format: "jpeg" }, { Kind: "image", Ref: "preview", Width: 320, Format: "jpeg" } } } } }, ) ``` ```js const task = await fetch('https://api.ittybit.com/tasks', { method: 'POST', headers: { 'Authorization': `Bearer ${ITTYBIT_API_KEY}` }, body: JSON.stringify({ url: "https://ittyb.it/sample.mp4", kind: "workflow", workflow: [ { kind: "conditions", conditions: [ { prop: "kind", value: "video" } ], next: [ { kind: "image", ref: "poster", width: 1280, format: "jpeg" }, { kind: "image", ref: "preview", width: 320, format: "jpeg" } ] } ] }) }) ```