0.16.1 • Published 8 months ago

workflow-manager v0.16.1

Weekly downloads
718
License
-
Repository
-
Last release
8 months ago

workflow-manager

workflow-manager client library.

WorkflowManager ⏏

workflow-manager client

Kind: Exported class

new WorkflowManager(options)

Create a new client object.

ParamTypeDefaultDescription
optionsObjectOptions for constructing a client object.
options.addressstringURL where the server is located. Must provide this or the discovery argument
options.discoveryboolUse clever-discovery to locate the server. Must provide this or the address argument
options.timeoutnumberThe timeout to use for all client requests, in milliseconds. This can be overridden on a per-request basis. Default is 5000ms.
options.keepaliveboolSet keepalive to true for client requests. This sets the forever: true attribute in request. Defaults to true.
options.retryPolicyRetryPoliciesRetryPolicies.SingleThe logic to determine which requests to retry, as well as how many times to retry.
options.loggermodule:kayvee.Loggerlogger.New("workflow-manager-wagclient")The Kayvee logger to use in the client.
options.circuitObjectOptions for constructing the client's circuit breaker.
options.circuit.forceClosedboolWhen set to true the circuit will always be closed. Default: true.
options.circuit.maxConcurrentRequestsnumberthe maximum number of concurrent requests the client can make at the same time. Default: 100.
options.circuit.requestVolumeThresholdnumberThe minimum number of requests needed before a circuit can be tripped due to health. Default: 20.
options.circuit.sleepWindownumberhow long, in milliseconds, to wait after a circuit opens before testing for recovery. Default: 5000.
options.circuit.errorPercentThresholdnumberthe threshold to place on the rolling error rate. Once the error rate exceeds this percentage, the circuit opens. Default: 90.

workflowManager.close()

Releases handles used in client

Kind: instance method of WorkflowManager

workflowManager.healthCheck(options, cb) ⇒ Promise

Checks if the service is healthy

Kind: instance method of WorkflowManager
Fulfill: undefined
Reject: BadRequest
Reject: InternalError
Reject: Error

ParamTypeDescription
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.postStateResource(NewStateResource, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: InternalError
Reject: Error

ParamTypeDescription
NewStateResource
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.deleteStateResource(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: undefined
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.namespacestring
params.namestring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getStateResource(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.namespacestring
params.namestring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.putStateResource(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.namespacestring
params.namestring
params.NewStateResource
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflowDefinitions(options, cb) ⇒ Promise

Get the latest versions of all available WorkflowDefinitions

Kind: instance method of WorkflowManager
Fulfill: Object[]
Reject: BadRequest
Reject: InternalError
Reject: Error

ParamTypeDescription
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.newWorkflowDefinition(NewWorkflowDefinitionRequest, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: InternalError
Reject: Error

ParamTypeDescription
NewWorkflowDefinitionRequest
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflowDefinitionVersionsByName(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object[]
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDefaultDescription
paramsObject
params.namestring
params.latestbooleantrue
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.updateWorkflowDefinition(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.NewWorkflowDefinitionRequest
params.namestring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflowDefinitionByNameAndVersion(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.namestring
params.versionnumber
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflows(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object[]
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDefaultDescription
paramsObject
params.limitnumber10Maximum number of workflows to return. Defaults to 10. Restricted to a max of 10,000.
params.oldestFirstboolean
params.pageTokenstring
params.statusstringThe status of the workflow (queued, running, etc.).
params.resolvedByUserbooleanA flag that indicates whether the workflow has been marked resolved by a user.
params.summaryOnlybooleanLimits workflow data to the bare minimum - omits the full workflow definition and job data.
params.workflowDefinitionNamestring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflowsIter(params, options) ⇒ Object | function | function | function | function

Kind: instance method of WorkflowManager
Returns: Object - iterfunction - iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an arrayfunction - iter.toArray - returns a promise to the resources as an arrayfunction - iter.forEach - takes in a function, applies it to each resourcefunction - iter.forEachAsync - takes in an async function, applies it to each resource

ParamTypeDefaultDescription
paramsObject
params.limitnumber10Maximum number of workflows to return. Defaults to 10. Restricted to a max of 10,000.
params.oldestFirstboolean
params.pageTokenstring
params.statusstringThe status of the workflow (queued, running, etc.).
params.resolvedByUserbooleanA flag that indicates whether the workflow has been marked resolved by a user.
params.summaryOnlybooleanLimits workflow data to the bare minimum - omits the full workflow definition and job data.
params.workflowDefinitionNamestring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy

workflowManager.startWorkflow(StartWorkflowRequest, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
StartWorkflowRequestParameters for starting a workflow (workflow definition, input, and optionally namespace, queue, and tags)
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.CancelWorkflow(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: undefined
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.workflowIDstring
params.reason
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.getWorkflowByID(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.workflowIDstring
params.fetchHistorybooleanWhen true, the execution history will be fetched from SFN along with the workflow summary
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.resumeWorkflowByID(params, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: Object
Reject: BadRequest
Reject: NotFound
Reject: InternalError
Reject: Error

ParamTypeDescription
paramsObject
params.workflowIDstring
params.overrides
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

workflowManager.resolveWorkflowByID(workflowID, options, cb) ⇒ Promise

Kind: instance method of WorkflowManager
Fulfill: undefined
Reject: BadRequest
Reject: NotFound
Reject: Conflict
Reject: InternalError
Reject: Error

ParamTypeDescription
workflowIDstring
optionsobject
options.timeoutnumberA request specific timeout
options.retryPolicyRetryPoliciesA request specific retryPolicy
cbfunction

WorkflowManager.RetryPolicies

Retry policies available to use.

Kind: static property of WorkflowManager

RetryPolicies.Exponential

The exponential retry policy will retry five times with an exponential backoff.

Kind: static constant of RetryPolicies

RetryPolicies.Single

Use this retry policy to retry a request once.

Kind: static constant of RetryPolicies

RetryPolicies.None

Use this retry policy to turn off retries.

Kind: static constant of RetryPolicies

WorkflowManager.Errors

Errors returned by methods.

Kind: static property of WorkflowManager

Errors.BadRequest ⇐ Error

BadRequest

Kind: static class of Errors
Extends: Error
Properties

NameType
messagestring

Errors.InternalError ⇐ Error

InternalError

Kind: static class of Errors
Extends: Error
Properties

NameType
messagestring

Errors.NotFound ⇐ Error

NotFound

Kind: static class of Errors
Extends: Error
Properties

NameType
messagestring

Errors.Conflict ⇐ Error

Conflict

Kind: static class of Errors
Extends: Error
Properties

NameType
messagestring

WorkflowManager.DefaultCircuitOptions

Default circuit breaker options.

Kind: static constant of WorkflowManager

0.16.0

9 months ago

0.16.1

8 months ago

0.15.1

1 year ago

0.14.3

2 years ago

0.14.1

3 years ago

0.14.2

3 years ago

0.14.0

3 years ago

0.13.1

3 years ago

0.13.0

3 years ago

0.12.0

4 years ago

0.11.4

5 years ago

0.11.3

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.9

5 years ago

0.9.8

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.5

6 years ago

0.7.4

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.12

6 years ago

0.6.11

6 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

1.0.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago