swf_poll_for_decision_task: Used by deciders to get a DecisionTask from the specified...

Description Usage Arguments Value Request syntax

View source: R/swf_operations.R

Description

Used by deciders to get a DecisionTask from the specified decision taskList. A decision task may be returned for any open workflow execution that is using the specified task list. The task includes a paginated view of the history of the workflow execution. The decider should use the workflow type and the history to determine how to properly handle the task.

This action initiates a long poll, where the service holds the HTTP connection open and responds as soon a task becomes available. If no decision task is available in the specified task list before the timeout of 60 seconds expires, an empty result is returned. An empty result, in this context, means that a DecisionTask is returned, but that the value of taskToken is an empty string.

Deciders should set their client side socket timeout to at least 70 seconds (10 seconds higher than the timeout).

Because the number of workflow history events for a single workflow execution might be very large, the result returned might be split up across a number of pages. To retrieve subsequent pages, make additional calls to poll_for_decision_task using the nextPageToken returned by the initial call. Note that you do not call get_workflow_execution_history with this nextPageToken. Instead, call poll_for_decision_task again.

Access Control

You can use IAM policies to control this action's access to Amazon SWF resources as follows:

If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.

Usage

1
2
swf_poll_for_decision_task(domain, taskList, identity, nextPageToken,
  maximumPageSize, reverseOrder)

Arguments

domain

[required] The name of the domain containing the task lists to poll.

taskList

[required] Specifies the task list to poll for decision tasks.

The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.

identity

Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.

nextPageToken

If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".

The configured maximumPageSize determines how many results can be returned in a single call.

The nextPageToken returned by this action cannot be used with get_workflow_execution_history to get the next page. You must call poll_for_decision_task again (with the nextPageToken) to retrieve the next page of history records. Calling poll_for_decision_task with a nextPageToken doesn't return a new decision task.

maximumPageSize

The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.

This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.

reverseOrder

When set to true, returns the events in reverse order. By default the results are returned in ascending order of the eventTimestamp of the events.

Value

A list with the following syntax:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
list(
  taskToken = "string",
  startedEventId = 123,
  workflowExecution = list(
    workflowId = "string",
    runId = "string"
  ),
  workflowType = list(
    name = "string",
    version = "string"
  ),
  events = list(
    list(
      eventTimestamp = as.POSIXct(
        "2015-01-01"
      ),
      eventType = "WorkflowExecutionStarted"|"WorkflowExecutionCancelRequested"|"WorkflowExecutionCompleted"|"CompleteWorkflowExecutionFailed"|"WorkflowExecutionFailed"|"FailWorkflowExecutionFailed"|"WorkflowExecutionTimedOut"|"WorkflowExecutionCanceled"|"CancelWorkflowExecutionFailed"|"WorkflowExecutionContinuedAsNew"|"ContinueAsNewWorkflowExecutionFailed"|"WorkflowExecutionTerminated"|"DecisionTaskScheduled"|"DecisionTaskStarted"|"DecisionTaskCompleted"|"DecisionTaskTimedOut"|"ActivityTaskScheduled"|"ScheduleActivityTaskFailed"|"ActivityTaskStarted"|"ActivityTaskCompleted"|"ActivityTaskFailed"|"ActivityTaskTimedOut"|"ActivityTaskCanceled"|"ActivityTaskCancelRequested"|"RequestCancelActivityTaskFailed"|"WorkflowExecutionSignaled"|"MarkerRecorded"|"RecordMarkerFailed"|"TimerStarted"|"StartTimerFailed"|"TimerFired"|"TimerCanceled"|"CancelTimerFailed"|"StartChildWorkflowExecutionInitiated"|"StartChildWorkflowExecutionFailed"|"ChildWorkflowExecutionStarted"|"ChildWorkflowExecutionCompleted"|"ChildWorkflowExecutionFailed"|"ChildWorkflowExecutionTimedOut"|"ChildWorkflowExecutionCanceled"|"ChildWorkflowExecutionTerminated"|"SignalExternalWorkflowExecutionInitiated"|"SignalExternalWorkflowExecutionFailed"|"ExternalWorkflowExecutionSignaled"|"RequestCancelExternalWorkflowExecutionInitiated"|"RequestCancelExternalWorkflowExecutionFailed"|"ExternalWorkflowExecutionCancelRequested"|"LambdaFunctionScheduled"|"LambdaFunctionStarted"|"LambdaFunctionCompleted"|"LambdaFunctionFailed"|"LambdaFunctionTimedOut"|"ScheduleLambdaFunctionFailed"|"StartLambdaFunctionFailed",
      eventId = 123,
      workflowExecutionStartedEventAttributes = list(
        input = "string",
        executionStartToCloseTimeout = "string",
        taskStartToCloseTimeout = "string",
        childPolicy = "TERMINATE"|"REQUEST_CANCEL"|"ABANDON",
        taskList = list(
          name = "string"
        ),
        taskPriority = "string",
        workflowType = list(
          name = "string",
          version = "string"
        ),
        tagList = list(
          "string"
        ),
        continuedExecutionRunId = "string",
        parentWorkflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        parentInitiatedEventId = 123,
        lambdaRole = "string"
      ),
      workflowExecutionCompletedEventAttributes = list(
        result = "string",
        decisionTaskCompletedEventId = 123
      ),
      completeWorkflowExecutionFailedEventAttributes = list(
        cause = "UNHANDLED_DECISION"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      workflowExecutionFailedEventAttributes = list(
        reason = "string",
        details = "string",
        decisionTaskCompletedEventId = 123
      ),
      failWorkflowExecutionFailedEventAttributes = list(
        cause = "UNHANDLED_DECISION"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      workflowExecutionTimedOutEventAttributes = list(
        timeoutType = "START_TO_CLOSE",
        childPolicy = "TERMINATE"|"REQUEST_CANCEL"|"ABANDON"
      ),
      workflowExecutionCanceledEventAttributes = list(
        details = "string",
        decisionTaskCompletedEventId = 123
      ),
      cancelWorkflowExecutionFailedEventAttributes = list(
        cause = "UNHANDLED_DECISION"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      workflowExecutionContinuedAsNewEventAttributes = list(
        input = "string",
        decisionTaskCompletedEventId = 123,
        newExecutionRunId = "string",
        executionStartToCloseTimeout = "string",
        taskList = list(
          name = "string"
        ),
        taskPriority = "string",
        taskStartToCloseTimeout = "string",
        childPolicy = "TERMINATE"|"REQUEST_CANCEL"|"ABANDON",
        tagList = list(
          "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        lambdaRole = "string"
      ),
      continueAsNewWorkflowExecutionFailedEventAttributes = list(
        cause = "UNHANDLED_DECISION"|"WORKFLOW_TYPE_DEPRECATED"|"WORKFLOW_TYPE_DOES_NOT_EXIST"|"DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_TASK_LIST_UNDEFINED"|"DEFAULT_CHILD_POLICY_UNDEFINED"|"CONTINUE_AS_NEW_WORKFLOW_EXECUTION_RATE_EXCEEDED"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      workflowExecutionTerminatedEventAttributes = list(
        reason = "string",
        details = "string",
        childPolicy = "TERMINATE"|"REQUEST_CANCEL"|"ABANDON",
        cause = "CHILD_POLICY_APPLIED"|"EVENT_LIMIT_EXCEEDED"|"OPERATOR_INITIATED"
      ),
      workflowExecutionCancelRequestedEventAttributes = list(
        externalWorkflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        externalInitiatedEventId = 123,
        cause = "CHILD_POLICY_APPLIED"
      ),
      decisionTaskScheduledEventAttributes = list(
        taskList = list(
          name = "string"
        ),
        taskPriority = "string",
        startToCloseTimeout = "string"
      ),
      decisionTaskStartedEventAttributes = list(
        identity = "string",
        scheduledEventId = 123
      ),
      decisionTaskCompletedEventAttributes = list(
        executionContext = "string",
        scheduledEventId = 123,
        startedEventId = 123
      ),
      decisionTaskTimedOutEventAttributes = list(
        timeoutType = "START_TO_CLOSE",
        scheduledEventId = 123,
        startedEventId = 123
      ),
      activityTaskScheduledEventAttributes = list(
        activityType = list(
          name = "string",
          version = "string"
        ),
        activityId = "string",
        input = "string",
        control = "string",
        scheduleToStartTimeout = "string",
        scheduleToCloseTimeout = "string",
        startToCloseTimeout = "string",
        taskList = list(
          name = "string"
        ),
        taskPriority = "string",
        decisionTaskCompletedEventId = 123,
        heartbeatTimeout = "string"
      ),
      activityTaskStartedEventAttributes = list(
        identity = "string",
        scheduledEventId = 123
      ),
      activityTaskCompletedEventAttributes = list(
        result = "string",
        scheduledEventId = 123,
        startedEventId = 123
      ),
      activityTaskFailedEventAttributes = list(
        reason = "string",
        details = "string",
        scheduledEventId = 123,
        startedEventId = 123
      ),
      activityTaskTimedOutEventAttributes = list(
        timeoutType = "START_TO_CLOSE"|"SCHEDULE_TO_START"|"SCHEDULE_TO_CLOSE"|"HEARTBEAT",
        scheduledEventId = 123,
        startedEventId = 123,
        details = "string"
      ),
      activityTaskCanceledEventAttributes = list(
        details = "string",
        scheduledEventId = 123,
        startedEventId = 123,
        latestCancelRequestedEventId = 123
      ),
      activityTaskCancelRequestedEventAttributes = list(
        decisionTaskCompletedEventId = 123,
        activityId = "string"
      ),
      workflowExecutionSignaledEventAttributes = list(
        signalName = "string",
        input = "string",
        externalWorkflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        externalInitiatedEventId = 123
      ),
      markerRecordedEventAttributes = list(
        markerName = "string",
        details = "string",
        decisionTaskCompletedEventId = 123
      ),
      recordMarkerFailedEventAttributes = list(
        markerName = "string",
        cause = "OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      timerStartedEventAttributes = list(
        timerId = "string",
        control = "string",
        startToFireTimeout = "string",
        decisionTaskCompletedEventId = 123
      ),
      timerFiredEventAttributes = list(
        timerId = "string",
        startedEventId = 123
      ),
      timerCanceledEventAttributes = list(
        timerId = "string",
        startedEventId = 123,
        decisionTaskCompletedEventId = 123
      ),
      startChildWorkflowExecutionInitiatedEventAttributes = list(
        workflowId = "string",
        workflowType = list(
          name = "string",
          version = "string"
        ),
        control = "string",
        input = "string",
        executionStartToCloseTimeout = "string",
        taskList = list(
          name = "string"
        ),
        taskPriority = "string",
        decisionTaskCompletedEventId = 123,
        childPolicy = "TERMINATE"|"REQUEST_CANCEL"|"ABANDON",
        taskStartToCloseTimeout = "string",
        tagList = list(
          "string"
        ),
        lambdaRole = "string"
      ),
      childWorkflowExecutionStartedEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        initiatedEventId = 123
      ),
      childWorkflowExecutionCompletedEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        result = "string",
        initiatedEventId = 123,
        startedEventId = 123
      ),
      childWorkflowExecutionFailedEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        reason = "string",
        details = "string",
        initiatedEventId = 123,
        startedEventId = 123
      ),
      childWorkflowExecutionTimedOutEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        timeoutType = "START_TO_CLOSE",
        initiatedEventId = 123,
        startedEventId = 123
      ),
      childWorkflowExecutionCanceledEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        details = "string",
        initiatedEventId = 123,
        startedEventId = 123
      ),
      childWorkflowExecutionTerminatedEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        workflowType = list(
          name = "string",
          version = "string"
        ),
        initiatedEventId = 123,
        startedEventId = 123
      ),
      signalExternalWorkflowExecutionInitiatedEventAttributes = list(
        workflowId = "string",
        runId = "string",
        signalName = "string",
        input = "string",
        decisionTaskCompletedEventId = 123,
        control = "string"
      ),
      externalWorkflowExecutionSignaledEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        initiatedEventId = 123
      ),
      signalExternalWorkflowExecutionFailedEventAttributes = list(
        workflowId = "string",
        runId = "string",
        cause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"|"SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED"|"OPERATION_NOT_PERMITTED",
        initiatedEventId = 123,
        decisionTaskCompletedEventId = 123,
        control = "string"
      ),
      externalWorkflowExecutionCancelRequestedEventAttributes = list(
        workflowExecution = list(
          workflowId = "string",
          runId = "string"
        ),
        initiatedEventId = 123
      ),
      requestCancelExternalWorkflowExecutionInitiatedEventAttributes = list(
        workflowId = "string",
        runId = "string",
        decisionTaskCompletedEventId = 123,
        control = "string"
      ),
      requestCancelExternalWorkflowExecutionFailedEventAttributes = list(
        workflowId = "string",
        runId = "string",
        cause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"|"REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED"|"OPERATION_NOT_PERMITTED",
        initiatedEventId = 123,
        decisionTaskCompletedEventId = 123,
        control = "string"
      ),
      scheduleActivityTaskFailedEventAttributes = list(
        activityType = list(
          name = "string",
          version = "string"
        ),
        activityId = "string",
        cause = "ACTIVITY_TYPE_DEPRECATED"|"ACTIVITY_TYPE_DOES_NOT_EXIST"|"ACTIVITY_ID_ALREADY_IN_USE"|"OPEN_ACTIVITIES_LIMIT_EXCEEDED"|"ACTIVITY_CREATION_RATE_EXCEEDED"|"DEFAULT_SCHEDULE_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_TASK_LIST_UNDEFINED"|"DEFAULT_SCHEDULE_TO_START_TIMEOUT_UNDEFINED"|"DEFAULT_START_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_HEARTBEAT_TIMEOUT_UNDEFINED"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      requestCancelActivityTaskFailedEventAttributes = list(
        activityId = "string",
        cause = "ACTIVITY_ID_UNKNOWN"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      startTimerFailedEventAttributes = list(
        timerId = "string",
        cause = "TIMER_ID_ALREADY_IN_USE"|"OPEN_TIMERS_LIMIT_EXCEEDED"|"TIMER_CREATION_RATE_EXCEEDED"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      cancelTimerFailedEventAttributes = list(
        timerId = "string",
        cause = "TIMER_ID_UNKNOWN"|"OPERATION_NOT_PERMITTED",
        decisionTaskCompletedEventId = 123
      ),
      startChildWorkflowExecutionFailedEventAttributes = list(
        workflowType = list(
          name = "string",
          version = "string"
        ),
        cause = "WORKFLOW_TYPE_DOES_NOT_EXIST"|"WORKFLOW_TYPE_DEPRECATED"|"OPEN_CHILDREN_LIMIT_EXCEEDED"|"OPEN_WORKFLOWS_LIMIT_EXCEEDED"|"CHILD_CREATION_RATE_EXCEEDED"|"WORKFLOW_ALREADY_RUNNING"|"DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_TASK_LIST_UNDEFINED"|"DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED"|"DEFAULT_CHILD_POLICY_UNDEFINED"|"OPERATION_NOT_PERMITTED",
        workflowId = "string",
        initiatedEventId = 123,
        decisionTaskCompletedEventId = 123,
        control = "string"
      ),
      lambdaFunctionScheduledEventAttributes = list(
        id = "string",
        name = "string",
        control = "string",
        input = "string",
        startToCloseTimeout = "string",
        decisionTaskCompletedEventId = 123
      ),
      lambdaFunctionStartedEventAttributes = list(
        scheduledEventId = 123
      ),
      lambdaFunctionCompletedEventAttributes = list(
        scheduledEventId = 123,
        startedEventId = 123,
        result = "string"
      ),
      lambdaFunctionFailedEventAttributes = list(
        scheduledEventId = 123,
        startedEventId = 123,
        reason = "string",
        details = "string"
      ),
      lambdaFunctionTimedOutEventAttributes = list(
        scheduledEventId = 123,
        startedEventId = 123,
        timeoutType = "START_TO_CLOSE"
      ),
      scheduleLambdaFunctionFailedEventAttributes = list(
        id = "string",
        name = "string",
        cause = "ID_ALREADY_IN_USE"|"OPEN_LAMBDA_FUNCTIONS_LIMIT_EXCEEDED"|"LAMBDA_FUNCTION_CREATION_RATE_EXCEEDED"|"LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION",
        decisionTaskCompletedEventId = 123
      ),
      startLambdaFunctionFailedEventAttributes = list(
        scheduledEventId = 123,
        cause = "ASSUME_ROLE_FAILED",
        message = "string"
      )
    )
  ),
  nextPageToken = "string",
  previousStartedEventId = 123
)

Request syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
svc$poll_for_decision_task(
  domain = "string",
  taskList = list(
    name = "string"
  ),
  identity = "string",
  nextPageToken = "string",
  maximumPageSize = 123,
  reverseOrder = TRUE|FALSE
)

paws.application.integration documentation built on Aug. 23, 2021, 9:20 a.m.