How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • new tasks.GlueStartJobRun(this, 'Task', {
      glueJobName: 'my-glue-job',
      arguments: sfn.TaskInput.fromObject({
        key: 'value',
      }),
      timeout: Duration.minutes(30),
      notifyDelayAfter: Duration.minutes(5),
    });
    
    Docs
    0
  • declare const fn: lambda.Function;
    new tasks.LambdaInvoke(this, 'Invoke with callback', {
      lambdaFunction: fn,
      integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
      payload: sfn.TaskInput.fromObject({
        token: sfn.JsonPath.taskToken,
        input: sfn.JsonPath.stringAt('$.someField'),
      }),
    });
    
    Docs
    0
  • declare const fn: lambda.Function;
    new tasks.LambdaInvoke(this, 'Invoke with empty object as payload', {
      lambdaFunction: fn,
      payload: sfn.TaskInput.fromObject({}),
    });
    
    // use the output of fn as input
    new tasks.LambdaInvoke(this, 'Invoke with payload field in the state input', {
      lambdaFunction: fn,
      payload: sfn.TaskInput.fromJsonPathAt('$.Payload'),
    });
    
    Docs
    0
  • import * as events from '@aws-cdk/aws-events';
    
    const myEventBus = new events.EventBus(this, 'EventBus', {
      eventBusName: 'MyEventBus1',
    });
    
    new tasks.EventBridgePutEvents(this, 'Send an event to EventBridge', {
      entries: [{
        detail: sfn.TaskInput.fromObject({
          Message: 'Hello from Step Functions!',
        }),
        eventBus: myEventBus,
        detailType: 'MessageFromStepFunctions',
        source: 'step.functions',
      }],
    });
    
    Docs
    0
  • const topic = new sns.Topic(this, 'Topic');
    
    // Use a field from the execution data as message.
    const task1 = new tasks.SnsPublish(this, 'Publish1', {
      topic,
      integrationPattern: sfn.IntegrationPattern.REQUEST_RESPONSE,
      message: sfn.TaskInput.fromDataAt('$.state.message'),
      messageAttributes: {
        place: {
          value: sfn.JsonPath.stringAt('$.place'),
        },
        pic: {
          // BINARY must be explicitly set
          dataType: tasks.MessageAttributeDataType.BINARY,
          value: sfn.JsonPath.stringAt('$.pic'),
        },
        people: {
          value: 4,
        },
        handles: {
          value: ['@kslater', '@jjf', null, '@mfanning'],
        },
      },
    });
    
    // Combine a field from the execution data with
    // a literal object.
    const task2 = new tasks.SnsPublish(this, 'Publish2', {
      topic,
      message: sfn.TaskInput.fromObject({
        field1: 'somedata',
        field2: sfn.JsonPath.stringAt('$.field2'),
      }),
    });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
    import * as cdk from '@aws-cdk/core';
    
    declare const parameters: any;
    declare const stepFunctionsTask: stepfunctions.IStepFunctionsTask;
    
    const task = new stepfunctions.Task(this, 'MyTask', {
      task: stepFunctionsTask,
    
      // the properties below are optional
      comment: 'comment',
      inputPath: 'inputPath',
      outputPath: 'outputPath',
      parameters: {
        parametersKey: parameters,
      },
      resultPath: 'resultPath',
      timeout: cdk.Duration.minutes(30),
    });
    
    Docs
    0
  • const queue = new sqs.Queue(this, 'Queue');
    
    // Use a field from the execution data as message.
    const task1 = new tasks.SqsSendMessage(this, 'Send1', {
      queue,
      messageBody: sfn.TaskInput.fromJsonPathAt('$.message'),
    });
    
    // Combine a field from the execution data with
    // a literal object.
    const task2 = new tasks.SqsSendMessage(this, 'Send2', {
      queue,
      messageBody: sfn.TaskInput.fromObject({
        field1: 'somedata',
        field2: sfn.JsonPath.stringAt('$.field2'),
      }),
    });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as sqs from '@aws-cdk/aws-sqs';
    import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
    import * as stepfunctions_tasks from '@aws-cdk/aws-stepfunctions-tasks';
    import * as cdk from '@aws-cdk/core';
    
    declare const queue: sqs.Queue;
    declare const taskInput: stepfunctions.TaskInput;
    
    const sendToQueue = new stepfunctions_tasks.SendToQueue(queue, {
      messageBody: taskInput,
    
      // the properties below are optional
      delay: cdk.Duration.minutes(30),
      integrationPattern: stepfunctions.ServiceIntegrationPattern.FIRE_AND_FORGET,
      messageDeduplicationId: 'messageDeduplicationId',
      messageGroupId: 'messageGroupId',
    });
    
    Docs
    0
  • const topic = new sns.Topic(this, 'Topic');
    
    // Use a field from the execution data as message.
    const task1 = new tasks.SnsPublish(this, 'Publish1', {
      topic,
      integrationPattern: sfn.IntegrationPattern.REQUEST_RESPONSE,
      message: sfn.TaskInput.fromDataAt('$.state.message'),
      messageAttributes: {
        place: {
          value: sfn.JsonPath.stringAt('$.place'),
        },
        pic: {
          // BINARY must be explicitly set
          dataType: tasks.MessageAttributeDataType.BINARY,
          value: sfn.JsonPath.stringAt('$.pic'),
        },
        people: {
          value: 4,
        },
        handles: {
          value: ['@kslater', '@jjf', null, '@mfanning'],
        },
      },
    });
    
    // Combine a field from the execution data with
    // a literal object.
    const task2 = new tasks.SnsPublish(this, 'Publish2', {
      topic,
      message: sfn.TaskInput.fromObject({
        field1: 'somedata',
        field2: sfn.JsonPath.stringAt('$.field2'),
      }),
    });
    
    Docs
    0
  • const convertToSeconds = new tasks.EvaluateExpression(this, 'Convert to seconds', {
      expression: '$.waitMilliseconds / 1000',
      resultPath: '$.waitSeconds',
    });
    
    const createMessage = new tasks.EvaluateExpression(this, 'Create message', {
      // Note: this is a string inside a string.
      expression: '`Now waiting ${$.waitSeconds} seconds...`',
      runtime: lambda.Runtime.NODEJS_14_X,
      resultPath: '$.message',
    });
    
    const publishMessage = new tasks.SnsPublish(this, 'Publish message', {
      topic: new sns.Topic(this, 'cool-topic'),
      message: sfn.TaskInput.fromJsonPathAt('$.message'),
      resultPath: '$.sns',
    });
    
    const wait = new sfn.Wait(this, 'Wait', {
      time: sfn.WaitTime.secondsPath('$.waitSeconds'),
    });
    
    new sfn.StateMachine(this, 'StateMachine', {
      definition: convertToSeconds
        .next(createMessage)
        .next(publishMessage)
        .next(wait),
    });
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples