![Introducing Dashboard Analytics](https://cdn.sanity.io/images/cgdhsj6q/production/af327c5bd94708db501516a75da6870aef894c64-2286x1522.png?w=400&fit=max&auto=format)
Product
Introducing Dashboard Analytics
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
@temporalio/common
Advanced tools
@temporalio/common is a package that provides common utilities and types for use with the Temporal workflow orchestration engine. It is designed to facilitate the development of workflows and activities by providing shared types and helper functions.
Workflow Execution
This feature allows you to start a workflow execution using the Temporal client. The code sample demonstrates how to connect to the Temporal service and start a workflow.
const { WorkflowClient } = require('@temporalio/client');
const { Connection } = require('@temporalio/common');
async function run() {
const connection = await Connection.connect();
const client = new WorkflowClient(connection.service);
const handle = await client.start('myWorkflow', { taskQueue: 'my-task-queue' });
console.log(`Started workflow ${handle.workflowId}`);
}
run().catch(err => console.error(err));
Activity Definition
This feature allows you to define activities that can be executed within workflows. The code sample shows how to define a simple activity that takes an input and returns a greeting message.
const { defineActivity } = require('@temporalio/common');
const myActivity = defineActivity(async (input) => {
return `Hello, ${input.name}!`;
});
module.exports = { myActivity };
Workflow Definition
This feature allows you to define workflows that orchestrate the execution of activities. The code sample demonstrates how to define a workflow that calls an activity and returns its result.
const { defineWorkflow } = require('@temporalio/common');
const { myActivity } = require('./activities');
const myWorkflow = defineWorkflow(async (input) => {
const result = await myActivity({ name: input.name });
return result;
});
module.exports = { myWorkflow };
The AWS SDK for JavaScript provides a set of tools for interacting with AWS services. It includes functionality for managing workflows using AWS Step Functions, which is similar to Temporal's workflow orchestration capabilities. However, AWS Step Functions are more tightly integrated with the AWS ecosystem.
Bull is a Node.js library for creating robust job queues. It provides features for job scheduling and processing, which can be used to implement workflow-like behavior. Unlike Temporal, Bull does not provide built-in support for long-running workflows and state management.
Agenda is a lightweight job scheduling library for Node.js. It allows you to define and manage jobs that can be scheduled to run at specific times or intervals. While it provides some workflow-like capabilities, it lacks the advanced orchestration and state management features of Temporal.
FAQs
Common library for code that's used across the Client, Worker, and/or Workflow
The npm package @temporalio/common receives a total of 151,080 weekly downloads. As such, @temporalio/common popularity was classified as popular.
We found that @temporalio/common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Product
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
Security News
A new OpenSSF report uncovers critical gaps in secure software training, with 75% of new developers unfamiliar with secure practices, highlighting urgent educational needs.
Security News
The 2023 Python Developers Survey reveals key trends in packaging, web frameworks, and developer demographics, highlighting a shift toward innovative tools as the Python community diversifies and grows among less experienced developers.