Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Faktory Worker

A worker client for Faktory.


Faktory Worker documentation is available at

Getting up and running

To get started with Faktory Worker first add the dependency to your mix.exs file.

defp deps do
    {:faktory_worker, "~> 1.9.3"}

Faktory Worker can then be configured to start as part of your application by adding it to the Application.start/2 function.

defmodule MyApp.Application do
  use Application

  def start(_, _) do
    children = [

      strategy: :one_for_one,
      name: MyApp.Supervisor

Make sure you have configured your application to start in your mix.exs file.

def application do
    mod: {MyApp.Application, []}

This will start Faktory Worker using the default configuration. For details on how to configure Faktory Worker see the FaktoryWorker documentation.

Next you can create a worker to handle job processing.

defmodule MyApp.SomeWorker do
  use FaktoryWorker.Job

  def perform(job_data) do

Now you can start sending jobs to faktory and they will be automatically picked up by the worker.

:ok = MyApp.SomeWorker.perform_async("hey there!")

Important! Since version 1.6.1 Broadway was removed from dependencies and response from perfomr_async is tuple {:ok, job_meta} with meta information about scheduled job.

{:ok, job_meta} = MyApp.SomeWorker.perform_async("hey there!")

Sending multiple job arguments

It's possible to send more than one argument to Faktory by passing a list of data to perform_async/1. Picking up from the example in the Getting up and running section we can modify our worker by adding another perform function with an arity that matches the number of job arguments we expect to send to Faktory.

defmodule MyApp.SomeWorker do
  use FaktoryWorker.Job


  def perform(arg1, arg2) do
    do_some_work(arg1, arg2)

With this new function in place you can now send multiple job arguments to Faktory.

:ok = MyApp.SomeWorker.perform_async(["arg 1", "arg 2"])


The full list of configuration options are available in the Configuration documentation.


By default Faktory Worker will not output any log messages but instead emit events using the Telemetry library.

To enable the built in logging you will need to attach the default Telemetry handler provided by FaktoryWorker. The ideal place to do this is in your Application.start/2 callback.

defmodule MyApp.Application do
  use Application

  def start(_, _) do


With this in place Faktory Worker will now output log messages for each of the events emitted.

For a full list of Faktory Worker events or for details on handling these events see the Logging documentation.


We always appreciate contributions whether they are testing, reporting issues, feedback or submitting PRs. If you would like to work on Faktory Worker please follow the Developing section for details on how to get setup for developing and running the test suite.


Faktory Worker includes a docker compose file that provisions all of the Faktory instances required to run the test suite.

If you have docker compose installed you can run the up command from the Faktory Worker directory to start everything required.

$ docker-compose up -d
Creating faktory_worker_test          ... done
Creating faktory_worker_test_tls      ... done
Creating faktory_worker_password_test ... done

Faktory have free open-source solution and enterprise edition.

If you don't have enterprise license then tests will fail on enterprise features (batching operations etc). In this case you can exclude them by tag :enterprise

$ mix test --exclude enterprise

If you are enterprise user all tests should pass

$ mix test