You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@aws-sdk/client-swf

Package Overview
Dependencies
Maintainers
5
Versions
383
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-swf

AWS SDK for JavaScript Swf Client for Node.js, Browser and React Native


Version published
Weekly downloads
112K
decreased by-23.94%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @aws-sdk/client-swf?

@aws-sdk/client-swf is an AWS SDK for JavaScript package that allows developers to interact with the Amazon Simple Workflow Service (SWF). SWF helps developers build, run, and scale background jobs that have parallel or sequential steps. It provides a way to coordinate work across distributed components and track the progress of workflows.

What are @aws-sdk/client-swf's main functionalities?

Start a Workflow Execution

This feature allows you to start a new workflow execution in a specified domain. You need to provide the domain, workflow ID, workflow type, task list, and any input data required for the workflow.

const { SWFClient, StartWorkflowExecutionCommand } = require('@aws-sdk/client-swf');

const client = new SWFClient({ region: 'us-west-2' });

const params = {
  domain: 'example-domain',
  workflowId: 'example-workflow-id',
  workflowType: {
    name: 'example-workflow-type',
    version: '1.0'
  },
  taskList: { name: 'example-task-list' },
  input: JSON.stringify({ key: 'value' })
};

const command = new StartWorkflowExecutionCommand(params);

client.send(command).then(
  (data) => console.log('Workflow started:', data),
  (error) => console.error('Error starting workflow:', error)
);

Poll for a Decision Task

This feature allows you to poll for a decision task from a specified task list. Decision tasks are used to determine the next steps in a workflow execution.

const { SWFClient, PollForDecisionTaskCommand } = require('@aws-sdk/client-swf');

const client = new SWFClient({ region: 'us-west-2' });

const params = {
  domain: 'example-domain',
  taskList: { name: 'example-task-list' }
};

const command = new PollForDecisionTaskCommand(params);

client.send(command).then(
  (data) => console.log('Decision task:', data),
  (error) => console.error('Error polling for decision task:', error)
);

Respond to a Decision Task

This feature allows you to respond to a decision task by providing the task token and the decisions made. In this example, the decision is to complete the workflow execution with a specified result.

const { SWFClient, RespondDecisionTaskCompletedCommand } = require('@aws-sdk/client-swf');

const client = new SWFClient({ region: 'us-west-2' });

const params = {
  taskToken: 'example-task-token',
  decisions: [
    {
      decisionType: 'CompleteWorkflowExecution',
      completeWorkflowExecutionDecisionAttributes: {
        result: JSON.stringify({ key: 'value' })
      }
    }
  ]
};

const command = new RespondDecisionTaskCompletedCommand(params);

client.send(command).then(
  (data) => console.log('Decision task completed:', data),
  (error) => console.error('Error responding to decision task:', error)
);

Other packages similar to @aws-sdk/client-swf

Changelog

Source

1.0.0-rc.8 (2020-12-05)

Bug Fixes

  • client-s3: fix union serialization (#1730) (6437e24)
  • client-sts: disable auth for public assumeRole commands (#1706) (891eae2)
  • codegen: checkstyle errors in AddBuiltinPlugins.java (#1731) (48c02f4)
  • middleware-sdk-sqs: Fix MD5 verification on SendMessageBatch. (#1666) (049f45e)
  • s3-request-presigner: skip hoisting SSE headers (#1701) (1ec70ff)

Features

Readme

Source

@aws-sdk/client-swf

NPM version NPM downloads

For SDK usage, please step to SDK readme.

FAQs

Package last updated on 05 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc